fix: avoid crash with --stats -a (#4765)

This commit is contained in:
Harshavardhana
2023-11-16 16:43:30 -08:00
committed by GitHub
parent 4724c024c6
commit fe05b5bb42
+3 -3
View File
@@ -935,9 +935,6 @@ func (s *statTrace) add(t madmin.ServiceTraceInfo) {
if got.MaxDur < t.Trace.Duration {
got.MaxDur = t.Trace.Duration
}
if got.MaxTTFB < t.Trace.HTTP.CallStats.TimeToFirstByte {
got.MaxTTFB = t.Trace.HTTP.CallStats.TimeToFirstByte
}
if got.MinDur <= 0 {
got.MinDur = t.Trace.Duration
}
@@ -954,6 +951,9 @@ func (s *statTrace) add(t madmin.ServiceTraceInfo) {
got.CallStats.Rx += t.Trace.HTTP.CallStats.InputBytes
got.CallStats.Tx += t.Trace.HTTP.CallStats.OutputBytes
got.TTFB += t.Trace.HTTP.CallStats.TimeToFirstByte
if got.MaxTTFB < t.Trace.HTTP.CallStats.TimeToFirstByte {
got.MaxTTFB = t.Trace.HTTP.CallStats.TimeToFirstByte
}
}
s.Calls[id] = got
}