From 8e708ec1e2a2222a2d4e6ebafe3bda709da19be4 Mon Sep 17 00:00:00 2001 From: Naiyuan Tian <110135109+nytian@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:20:18 -0800 Subject: [PATCH 1/2] Update DurableTaskMetricsProvider.cs --- .../Listener/DurableTaskMetricsProvider.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs index 940823778..b58b9b2af 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs @@ -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.SerializeObjectthis.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 From 068009cdb4d329e88947555873163e38997e2b7c Mon Sep 17 00:00:00 2001 From: Naiyuan Tian <110135109+nytian@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:22:31 -0800 Subject: [PATCH 2/2] Fix typo --- .../Listener/DurableTaskMetricsProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs index b58b9b2af..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 @@ -61,7 +61,7 @@ public virtual async Task GetMetricsAsync() { metrics.PartitionCount = this.heartbeat.PartitionCount; metrics.ControlQueueLengths = JsonConvert.SerializeObject(this.heartbeat.ControlQueueLengths); - metrics.ControlQueueLatencies = JsonConvert.SerializeObjectthis.heartbeat.ControlQueueLatencies); + metrics.ControlQueueLatencies = JsonConvert.SerializeObject(this.heartbeat.ControlQueueLatencies); metrics.WorkItemQueueLength = this.heartbeat.WorkItemQueueLength; if (this.heartbeat.WorkItemQueueLatency > TimeSpan.Zero) {