-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Draft: Perf Counter Implementation #52679
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
Conversation
| /// <returns>The new value after incrementing.</returns> | ||
| public long IncrementRequestCount() | ||
| { | ||
| return Interlocked.Increment(ref _totalRequestCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request rate should be derived from http.server.request.duration metrics by taking the histogram count and dividing by 60 (the aggregation window) to get requests per second.
| /// <returns>The new value after incrementing.</returns> | ||
| public long IncrementExceptionCount() | ||
| { | ||
| return Interlocked.Increment(ref _totalExceptionCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception rate should be derived from process.runtime.dotnet.exceptions.count metrics from the System.Runtime meter by calculating count / 60 to get exceptions per second.
| description: "Request rate gauge (req/sec)"); | ||
|
|
||
| _processCpuGauge = _perfCounterMeter.CreateObservableGauge( | ||
| PerfCounterConstants.ProcessCpuInstrumentName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| _meterProvider = Sdk.CreateMeterProviderBuilder() | ||
| .AddMeter(StandardMetricConstants.StandardMetricMeterName) | ||
| .AddMeter(PerfCounterConstants.PerfCounterMeterName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be wired with customer's meter provider.
Saving the current state of perf counters implementation. Implements five performance counters, tests not implemented yet.