VictoriaMetrics/lib/streamaggr
Aliaksandr Valialkin 5354374b62
lib/streamaggr: follow-up for 9c3d44c8c9
- Consistently enumerate stream aggregation outputs in alphabetical order across the source code and docs.
  This should simplify future maintenance of the corresponding code and docs.

- Fix the link to `rate_sum()` at `see also` section of `rate_avg()` docs.

- Make more clear the docs for `rate_sum()` and `rate_avg()` outputs.

- Encapsulate output metric suffix inside rateAggrState. This eliminates possible bugs related
  to incorrect suffix passing to newRateAggrState().

- Rename rateAggrState.total field to less misleading rateAggrState.increase name, since it calculates
  counter increase in the current aggregation window.

- Set rateLastValueState.prevTimestamp on the first sample in time series instead of the second sample.
  This makes more clear the code logic.

- Move the code for removing outdated entries at rateAggrState into removeOldEntries() function.
  This make the code logic inside rateAggrState.flushState() more clear.

- Do not write output sample with zero value if there are no input series, which could be used
  for calculating the rate, e.g. if only a single sample is registered for every input series.

- Do not take into account input series with a single registered sample when calculating rate_avg(),
  since this leads to incorrect results.

- Move {rate,total}AggrState.flushState() function to the end of rate.go and total.go files, so they look more similar.
  This shuld simplify future mantenance.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6243
2024-07-15 08:40:09 +02:00
..
avg.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
count_samples.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
count_series.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
dedup.go lib/streamaggr: prevent from data race inside dedupAggrShard when samplesBuf can be updated in pushSamples() while their values are read in the flush() loop without das.mu lock 2024-06-11 17:31:16 +02:00
dedup_test.go lib/streamaggr: reduce memory allocations by using dedupAggrSample buffer per each dedupAggrShard 2024-06-10 16:38:42 +02:00
dedup_timing_test.go lib/streamaggr: reduce the number of duplicates per each sample in BenchmarkDedupAggr from 100 to 2 2024-06-10 16:38:41 +02:00
deduplicator.go lib/streamaggr: added stale samples metric, added metrics labels (#6462) 2024-07-01 14:56:17 +02:00
deduplicator_test.go app/vmagent/remotewrite,lib/streamaggr: re-use common code in tests after 879771808b 2024-07-03 15:21:36 +02:00
deduplicator_timing_test.go lib/streamaggr: added stale samples metric, added metrics labels (#6462) 2024-07-01 14:56:17 +02:00
histogram_bucket.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
last.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
max.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
min.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
quantiles.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
rate.go lib/streamaggr: follow-up for 9c3d44c8c9 2024-07-15 08:40:09 +02:00
stddev.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
stdvar.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
streamaggr.go lib/streamaggr: follow-up for 9c3d44c8c9 2024-07-15 08:40:09 +02:00
streamaggr_test.go lib/streamaggr: follow-up for 9c3d44c8c9 2024-07-15 08:40:09 +02:00
streamaggr_timing_test.go app/vmagent/remotewrite,lib/streamaggr: re-use common code in tests after 879771808b 2024-07-03 15:21:36 +02:00
sum_samples.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
total.go lib/streamaggr: follow-up for 9c3d44c8c9 2024-07-15 08:40:09 +02:00
unique_samples.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00