From 6b47ed08f2e685ed96bc16af3534c04af08249e8 Mon Sep 17 00:00:00 2001 From: Naiyuan Tian <110135109+nytian@users.noreply.github.com> Date: Sat, 7 Dec 2024 01:12:20 -0500 Subject: [PATCH] Fix SA1101 warnings at DurableTaskMetricsProvider (#2993) --- .../Listener/DurableTaskMetricsProvider.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs index 940823778..e13fb7995 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. #if !FUNCTIONS_V1 @@ -59,13 +59,13 @@ public virtual async Task GetMetricsAsync() if (this.heartbeat != null) { - metrics.PartitionCount = heartbeat.PartitionCount; - metrics.ControlQueueLengths = JsonConvert.SerializeObject(heartbeat.ControlQueueLengths); - metrics.ControlQueueLatencies = JsonConvert.SerializeObject(heartbeat.ControlQueueLatencies); - metrics.WorkItemQueueLength = heartbeat.WorkItemQueueLength; - if (heartbeat.WorkItemQueueLatency > TimeSpan.Zero) + metrics.PartitionCount = this.heartbeat.PartitionCount; + metrics.ControlQueueLengths = JsonConvert.SerializeObject(this.heartbeat.ControlQueueLengths); + metrics.ControlQueueLatencies = JsonConvert.SerializeObject(this.heartbeat.ControlQueueLatencies); + metrics.WorkItemQueueLength = this.heartbeat.WorkItemQueueLength; + if (this.heartbeat.WorkItemQueueLatency > TimeSpan.Zero) { - metrics.WorkItemQueueLatency = heartbeat.WorkItemQueueLatency.ToString(); + metrics.WorkItemQueueLatency = this.heartbeat.WorkItemQueueLatency.ToString(); } } @@ -92,4 +92,4 @@ internal DisconnectedPerformanceMonitor GetPerformanceMonitor() } } } -#endif \ No newline at end of file +#endif