mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/streamaggr: do not reset aggregation state after the aggregation took longer than the configured interval
It is better from user PoV preserving this state until the next flush
This commit is contained in:
parent
32653db7d5
commit
22d63ac7cd
@ -93,7 +93,7 @@ type Options struct {
|
|||||||
// The alignment of flushes can be disabled individually per each aggregation via no_align_flush_to_interval option.
|
// The alignment of flushes can be disabled individually per each aggregation via no_align_flush_to_interval option.
|
||||||
NoAlignFlushToInterval bool
|
NoAlignFlushToInterval bool
|
||||||
|
|
||||||
// FlushOnShutdown enables flush of incomplete aggregation state.
|
// FlushOnShutdown enables flush of incomplete aggregation state on startup and shutdown.
|
||||||
//
|
//
|
||||||
// By default incomplete state is dropped.
|
// By default incomplete state is dropped.
|
||||||
//
|
//
|
||||||
@ -126,7 +126,7 @@ type Config struct {
|
|||||||
// See also FlushOnShutdown.
|
// See also FlushOnShutdown.
|
||||||
NoAlignFlushToInterval *bool `yaml:"no_align_flush_to_interval,omitempty"`
|
NoAlignFlushToInterval *bool `yaml:"no_align_flush_to_interval,omitempty"`
|
||||||
|
|
||||||
// FlushOnShutdown defines whether to flush incomplete aggregation state.
|
// FlushOnShutdown defines whether to flush incomplete aggregation state on startup and shutdown.
|
||||||
// By default incomplete aggregation state is dropped, since it may confuse users.
|
// By default incomplete aggregation state is dropped, since it may confuse users.
|
||||||
FlushOnShutdown *bool `yaml:"flush_on_shutdown,omitempty"`
|
FlushOnShutdown *bool `yaml:"flush_on_shutdown,omitempty"`
|
||||||
|
|
||||||
@ -615,10 +615,6 @@ func (a *aggregator) runFlusher(pushFunc PushFunc, alignFlushToInterval, skipInc
|
|||||||
if alignFlushToInterval {
|
if alignFlushToInterval {
|
||||||
select {
|
select {
|
||||||
case <-t.C:
|
case <-t.C:
|
||||||
if skipIncompleteFlush && tickerWait(t) {
|
|
||||||
logger.Warnf("drop incomplete aggregation state because the previous flush took longer than interval=%s", interval)
|
|
||||||
a.flush(nil, interval, true)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user