Skip to content

Common performance counters for client operations #1081

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

Open
Yonisha opened this issue Mar 6, 2019 · 13 comments
Open

Common performance counters for client operations #1081

Yonisha opened this issue Mar 6, 2019 · 13 comments

Comments

@Yonisha
Copy link

Yonisha commented Mar 6, 2019

There's no indication on how long the client operations took.
It'll be very helpful to introduce common performance counters (operation duration/count/failures etc.)for the various operations to understand how it impacts application layer

@mgravell
Copy link
Collaborator

mgravell commented Mar 6, 2019

some of the overall counters already exist via GetCounters; timing, however, is relatively expensive to gather and quite hard to accurately summarise - I'd be cautious of that one; it also isn't particularly useful, as often you have 2000000 fast ops and 3 slow ones that took "too long" (for whatever that means), but against the 2000000 they won't show up. Happy to explore options, but it isn't trivial to design.

@Yonisha
Copy link
Author

Yonisha commented Mar 6, 2019

I am referring to client performance counters which are very useful in high throughput applications.
AFAIK GetCounters provides server side metrics. Am I missing anything?

@mgravell
Copy link
Collaborator

mgravell commented Mar 6, 2019

GetCounters is client metrics, not server metrics - where (just to be 100% clear) the library (and whatever you're doing with it) is a client in this context, and the actual redis-server is the server. Are we talking past eachother?

@sleemer
Copy link

sleemer commented Jun 4, 2019

@mgravell have you looked into App.Metrics? e.g. using their histogram metric would help to put all the timings into buckets and you won't miss those 3 slow ones...

@mgravell
Copy link
Collaborator

mgravell commented Jun 4, 2019 via email

@sleemer
Copy link

sleemer commented Jun 4, 2019

@mgravell, here is the link https://www.app-metrics.io/getting-started/metric-types/histograms/.
Another option could be https://github.com/HdrHistogram/HdrHistogram.NET... but it seems like it hasn't been updated for a while...

@NickCraver
Copy link
Collaborator

Fundamentally, all of these options incur an overhead cost for all operations and lower efficiency. Given the rare ask for this, I don't think we'd add this overhead to the library. It's something to keep in mind for the future, but since there's no cheap way to do it - it's likely not going to be worth adding.

@avireddy02
Copy link

@NickCraver @mgravell Any chance of exposing below internal fields to Public (readonly)? This will allow apps to build their metrics as needed. In Current version below data is only available when an exception is raised.

  • ManagedPool [mgr] (used vs available)
  • multiplexer._connectAttemptCount
  • multiplexer._connectCompletedCount
  • multiplexer._connectionCloseCount

@NickCraver
Copy link
Collaborator

@avireddy02 missed this request - indeed that sounds reasonable to expose (not as they are, but in some way). The other bits I want to add here are for example "last 2 connection logs" and similar - going to do a pass at better telemetry (not sent anywhere) that's accessible with a call to get a "package" of helpful data like some counters, config, last few errors, last few connection logs, last reasons to reconnect, etc.

@NickCraver NickCraver self-assigned this Jan 8, 2022
@rkarthick
Copy link
Contributor

Hi @NickCraver Is this something you are actively working on? Could you share any docs around this if it is present? If not, do you mind if I take a stab at this?

@NickCraver
Copy link
Collaborator

@rkarthick I have a branch started, but likely won't back to it for a week or two (other priorities), have it worked out in my head on approach but not documented down anywhere. Probably still easiest for me to get the initial counters in - help would be appreciated in thinking of counters though - for sure!

@rkarthick
Copy link
Contributor

rkarthick commented Jun 27, 2022 via email

@thompson-tomo
Copy link

Given the recent focus by Microsoft on supporting OpenTelemetry ie heavy theme in net 8 & the release of Aspire. What is the thought about recording this telemetry using System.Diagnostics.Metrics so that they can they be exported using an open Telemetry collector?

Key thing for me to be recording would be:

  • time taken to send Messages with filter for channel & server
  • Messages recieved with filter for channel & server
  • Database commands with Filter for action ie get or set, server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants