mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-11 14:53:49 +00:00
14 lines
291 B
Go
14 lines
291 B
Go
package streamaggr
|
|
|
|
type sumSamplesAggrValue struct {
|
|
sum float64
|
|
}
|
|
|
|
func (av *sumSamplesAggrValue) pushSample(ctx *pushSampleCtx) {
|
|
av.sum += ctx.sample.value
|
|
}
|
|
|
|
func (av *sumSamplesAggrValue) flush(ctx *flushCtx, key string) {
|
|
ctx.appendSeries(key, "sum_samples", av.sum)
|
|
av.sum = 0
|
|
}
|