-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Histogram percentile support #51
Comments
@lzap the Histogram embeds The current instances added to PCP from the histogram are at (https://sourcegraph.com/github.com/performancecopilot/speed/-/blob/metrics.go#L1429:79). So to add custom instances for |
Of course, I'm open to patches around any usecases that I've been unable to forsee. |
Would you prefer:
|
@lzap my original idea for this was to simply export I have also been thinking of doing functional options for all constructors in the library for some time, so you could do NewPCPHistogram(
...
WithPercentiles(50, 90, 95, 99),
...
) but this needs to be done for all types, and we'll probably pick this up this year in GSoC. Thoughts, @natoscott ? |
@suyash will talk to our student. His primary focus is on implementing metadata label support, which we should also consider using here. We can label histogram metrics as such, as well as individual instances as being percentiles - across all of PCP - allowing generic clients / monitoring tools to be able to consume histogram metrics meaningfully. |
@natoscott the idea is largely based on https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis. This needs to be done only for constructor functions ( |
Hey,
are there plans to give PCPHistorgram a percentile support in a way that when update function is called, it provides the instances? One idea would be to have an array of percentiles user is interested in and those would be added as instances named "perc_99" or "perc_95". For simplicity, just integer percentiles would be fine (50, 90, 95, 99). Would you accept such a patch?
If this is not planned or wanted, what is the best way of "plugging-in" the update function so percentiles gets passed into PCP? Maybe a callback function or similar pattern would do it so I could write my own handler.
Thanks!
The text was updated successfully, but these errors were encountered: