MCPcopy
hub / github.com/segmentio/kafka-go / snapshot

Method snapshot

stats.go:160–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158}
159
160func (s *summary) snapshot() SummaryStats {
161 avg := int64(0)
162 min := s.min.snapshot()
163 max := s.max.snapshot()
164 sum := s.sum.snapshot()
165 count := s.count.snapshot()
166
167 if count != 0 {
168 avg = int64(float64(sum) / float64(count))
169 }
170
171 return SummaryStats{
172 Avg: avg,
173 Min: min,
174 Max: max,
175 Count: count,
176 Sum: sum,
177 }
178}
179
180func (s *summary) snapshotDuration() DurationStats {
181 summary := s.snapshot()

Callers 1

snapshotDurationMethod · 0.95

Calls 1

snapshotMethod · 0.45

Tested by

no test coverage detected