cmetrics: add cmt_expire for expiring metrics.#246
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
With a long running test running under valgrind: |
|
I also monitored the CPU usage: |
gimme a bit, let me see what I can do. ** edit ** rebased. hopefully master has been fixed and tests can pass now. @piwai tests passed. @cosmo0920 this PR looks ready to be merged. should I add a unit test or two first? |
…assed expiration timestamp. Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
ae8ca7e to
c961ba6
Compare
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
251639b to
a8a1fc9
Compare
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
a8a1fc9 to
42ae0d0
Compare
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
… the other remain. Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
@cosmo0920 I added the NULL parameter check and the test for expiring cmt_untyped. |
|
A few things I think we should settle before merging:
Could you also add tests for the equal-timestamp boundary and exponential histograms? |
…p, return void. Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
8b719fc to
4fc4027
Compare
@edsiper all done for now. ** edit ** I'll add an off-by-one test today. |
…n boundary. Signed-off-by: Phillip Whelan <pwhelan@exis.cl>
|
I added a test called |

Add two new functions,
cmt_map_metrics_expirefor expiring metrics in acmt_mapandcmt_expirewhich uses the function to expire all the metrics inside acmetricscontext.This function is useful in general for removing metrics with labels for objects that will disappear, ie: PIDs, etc...
This will also be used in fluent/fluent-bit#7615.