Commit Graph

6 Commits

Author SHA1 Message Date
Sven Rebhan b658b2d403
feat(aggregators.merge): Allow to round metric timestamps (#15319) 2024-05-09 10:07:10 -05:00
Sebastian Spaink 43017e14dd
feat: migrate aggregator plugins to new sample config format (#10912) 2022-04-06 14:40:17 -06:00
Paweł Żak d9eb4d06c5
fix: Linter fixes for plugins/aggregators/[a-z]* (#10182)
Co-authored-by: Pawel Zak <Pawel Zak>
2021-11-30 15:18:33 -06:00
David Bennett 842a788022
Remove error return type from metric.New method (#9116)
* Remove error return type from metric.New method.

* Formatting changes for linter + gofmt

* Additional linter fixes.

* More linter fixes.

* Linter fix.

* address comments
2021-04-13 14:40:03 -04:00
Patrick Hemmer 910b726876
Optimize SeriesGrouper & aggregators.merge (#8391)
The previous implementation of SeriesGrouper required breaking a metric object apart into its constituents, converting tags and keys into unoptimized maps, only to have it put them back together into another metric object. This resulted in a significant performance overhead. This overhead was further compounded when the number of fields was large.

This change adds a new AddMetric method to SeriesGrouper which preserves the metric object and removes the back-and-forth conversion.

Additionlly the method used for calculating the metric's hash was switched to use maphash, which is optimized for this case.

----

Benchmarks

Before:

    BenchmarkMergeOne-16          106012	     11790 ns/op
    BenchmarkMergeTwo-16           48529	     24819 ns/op
    BenchmarkGroupID-16           780018	      1608 ns/op

After:

    BenchmarkMergeOne-16          907093	      1173 ns/op
    BenchmarkMergeTwo-16          508321	      2168 ns/op
    BenchmarkGroupID-16         11217788	      99.4 ns/op
2021-01-07 11:39:12 -05:00
Daniel Nelson fc6fb33067
Add merge aggregator (#6410) 2019-09-26 17:09:44 -07:00