perf(metrics): cache MxEventFamily names for per-event metric tags
WorkerClient.StageWorkerEvent and StreamEvents called Enum.ToString per event (per subscriber on the stream path). MxEventFamilyNames serves the contract-fixed names from a frozen lookup, falling back to ToString for undefined values so exported tag values are unchanged.
This commit is contained in:
@@ -183,7 +183,7 @@ public sealed class MxAccessGatewayService(
|
||||
// call is cancelled, instead of leaving it to the transport's own timeout.
|
||||
await responseStream.WriteAsync(publicEvent, context.CancellationToken).ConfigureAwait(false);
|
||||
metrics.RecordEventStreamSend(
|
||||
publicEvent.Family.ToString(),
|
||||
MxEventFamilyNames.Get(publicEvent.Family),
|
||||
Stopwatch.GetElapsedTime(sendStartTimestamp));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user