mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-11 14:53:49 +00:00
23 lines
414 B
Go
23 lines
414 B
Go
package streamaggr
|
|
|
|
type minAggrValue struct {
|
|
min float64
|
|
defined bool
|
|
}
|
|
|
|
func (av *minAggrValue) pushSample(ctx *pushSampleCtx) {
|
|
if ctx.sample.value < av.min || !av.defined {
|
|
av.min = ctx.sample.value
|
|
}
|
|
if !av.defined {
|
|
av.defined = true
|
|
}
|
|
}
|
|
|
|
func (av *minAggrValue) flush(ctx *flushCtx, key string) {
|
|
if av.defined {
|
|
ctx.appendSeries(key, "min", av.min)
|
|
av.defined = false
|
|
av.min = 0
|
|
}
|
|
}
|