Cache prometheusize rename between scrapes
After profiling the exporter because it had a somewhat high cpu usage, it reported that the regexp operations in this function accounts for more than 10% of the cpu time.
More precisely, the first call to prometheusize uses 3.79%, the second 5.86% (in exporter.MakeMetrics) and lastly it 1.03% (in exporter.MakeRawMetrics)
This all goes to zero if we cache them.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.
:white_check_mark: vigno88
:white_check_mark: idoqo
:x: vigno99
You have signed the CLA already but the status is still pending? Let us recheck it.
Hi @vigno88 looks like tests are still failing - also looks like the profile you shared was from before the change - will be nice to have both to see how they compare.
Hi, thanks for the quick response.
I'll take a look at the tests and yes i will provide a new profile.
Nathan AV
Hi, please also make sure that it's thread-safe.
i've signed the CLA a lot of time last week and I tried again today. It says that the signature was made, but the status of the issue doesn't update..
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 65.50%. Comparing base (
dc46ed5) to head (24099d3). Report is 104 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1080 +/- ##
==========================================
- Coverage 70.88% 65.50% -5.39%
==========================================
Files 28 29 +1
Lines 3569 3073 -496
==========================================
- Hits 2530 2013 -517
- Misses 904 922 +18
- Partials 135 138 +3
| Flag | Coverage Δ | |
|---|---|---|
| agent | 65.50% <100.00%> (-5.39%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
There are other changes is this profile, but this show the cpu usage of prometheusize after the changes. https://flamegraph.com/share/a322d13f-2f3a-11f0-8b23-2a8f4480f552
All the test have passed, and the signature for my account has passed (vigno99 is the user of my computer)
Thanks a lot for your contribution, @vigno88. I'll check with our internal QA team about testing this, and then we can merge.
Hi @vigno88 , ready to merge this now, but seems there were also some commits from @vigno99 , so the CLA needs to be signed by both accounts
vigno99 looks like an autogenerated git user on my work computer. It's not linked to any github account.. I can't log to anything with it