Skip to content

Commit db97013

Browse files
committed
Improve descriptions
1 parent 971f484 commit db97013

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Components/Components/src/ComponentsMetrics.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ public ComponentsMetrics(IMeterFactory meterFactory)
4444
_eventDuration = _meter.CreateHistogram(
4545
"aspnetcore.components.event_handler",
4646
unit: "s",
47-
description: "Duration of processing browser event.",
47+
description: "Duration of processing browser event. It includes business logic of the component but not affected child components.",
4848
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.ShortSecondsBucketBoundaries });
4949

5050
_parametersDuration = _lifeCycleMeter.CreateHistogram(
5151
"aspnetcore.components.update_parameters",
5252
unit: "s",
53-
description: "Duration of processing component parameters.",
53+
description: "Duration of processing component parameters. It includes business logic of the component.",
5454
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.BlazorRenderingSecondsBucketBoundaries });
5555

5656
_batchDuration = _lifeCycleMeter.CreateHistogram(
5757
"aspnetcore.components.render_diff",
5858
unit: "s",
59-
description: "Duration of rendering DOM update including network and browser time.",
59+
description: "Duration of rendering component tree and producing HTML diff. It includes business logic of the changed components.",
6060
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.BlazorRenderingSecondsBucketBoundaries });
6161
}
6262

src/Components/Components/src/RenderTree/Renderer.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,12 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
450450

451451
// collect trace
452452
Activity? activity = null;
453+
string receiverName = null;
454+
string methodName = null;
453455
if (ComponentActivitySource != null)
454456
{
455-
var receiverName = (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
456-
var methodName = callback.Delegate.Method?.Name;
457+
receiverName ??= (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
458+
methodName ??= callback.Delegate.Method?.Name;
457459
activity = ComponentActivitySource.StartEventActivity(receiverName, methodName, attributeName);
458460
}
459461

@@ -503,8 +505,8 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
503505
// collect metrics
504506
if (ComponentMetrics != null && ComponentMetrics.IsEventEnabled)
505507
{
506-
var receiverName = (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
507-
var methodName = callback.Delegate.Method?.Name;
508+
receiverName ??= (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
509+
methodName ??= callback.Delegate.Method?.Name;
508510
_ = ComponentMetrics.CaptureEventDuration(task, eventStartTimestamp, receiverName, methodName, attributeName);
509511
}
510512

@@ -518,8 +520,8 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
518520
{
519521
if (ComponentMetrics != null && ComponentMetrics.IsEventEnabled)
520522
{
521-
var receiverName = (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
522-
var methodName = callback.Delegate.Method?.Name;
523+
receiverName ??= (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
524+
methodName ??= callback.Delegate.Method?.Name;
523525
ComponentMetrics.FailEventSync(e, eventStartTimestamp, receiverName, methodName, attributeName);
524526
}
525527

0 commit comments

Comments
 (0)