-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize dpgSignature function in Prometheus receiver #2945
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2945 +/- ##
=======================================
Coverage 91.58% 91.58%
=======================================
Files 312 312
Lines 15351 15356 +5
=======================================
+ Hits 14059 14064 +5
Misses 883 883
Partials 409 409
Continue to review full report at Codecov.
|
8df19b8
to
d64f1c7
Compare
Just rebased this to HEAD, but contrib_tests keep on failing. Anything else I should be doing about this? The error is not related to this change. |
This function is invoked very often, which leads to high CPU usage when collecting Prometheus metrics. Benchmark results on my machine show 3x less CPU and almost 4x less memory used. Since I'm also changing the format of returned values (dropping superfluous characters), it will reduce overall memory usage of the receiver, because they are used as map keys. Benchmark result before this change: Benchmark_dpgSignature-6 1284531 969.6 ns/op 120 B/op 7 allocs/op Benchmark result after this change: Benchmark_dpgSignature-6 3515179 313.9 ns/op 32 B/op 2 allocs/op
Ok, looks like another rebase solved the problem. |
…lfx-agent (open-telemetry#2945) * Bump github.com/prometheus/common in /pkg/signalfx-agent Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.39.0 to 0.42.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.39.0...v0.42.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * make tidy --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Description:
dpgSignature is invoked very often, which leads to high CPU usage when
collecting Prometheus metrics.
Benchmark results on my machine show 3x less CPU and almost 4x less
memory used. Since I'm also changing the format of returned values
(dropping superfluous characters), it will reduce overall memory usage
of the receiver, because they are used as map keys.
Benchmark result before this change:
Benchmark_dpgSignature-6 1284531 969.6 ns/op 120 B/op 7 allocs/op
Benchmark result after this change:
Benchmark_dpgSignature-6 3515179 313.9 ns/op 32 B/op 2 allocs/op
Testing: Added benchmark and updated unit tests.