-
Notifications
You must be signed in to change notification settings - Fork 780
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
Minor refactoring for instrumentation libraries #5162
Minor refactoring for instrumentation libraries #5162
Conversation
{ | ||
var context = payload as HttpContext; | ||
if (context == null) | ||
{ | ||
AspNetCoreInstrumentationEventSource.Log.NullPayload(nameof(HttpInMetricsListener), EventName, HttpServerRequestDurationMetricName); | ||
AspNetCoreInstrumentationEventSource.Log.NullPayload(nameof(HttpInMetricsListener), nameof(OnStopEventWritten), HttpServerRequestDurationMetricName); |
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.
Updated this to log the name of the method instead.
|
||
public override void OnEventWritten(string name, object payload) | ||
{ | ||
if (name == OnStopEvent) |
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.
I have changed the order of the if
conditions. For the common case, we don't want to waste cycles doing a string match for the exception event first.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5162 +/- ##
==========================================
- Coverage 83.54% 83.48% -0.06%
==========================================
Files 297 297
Lines 12368 12367 -1
==========================================
- Hits 10333 10325 -8
- Misses 2035 2042 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Changes