PerformanceCounter.NextValue() always return 0 for "HTTP Service Request Queues" MaxQueueItemAge #109956
Labels
area-System.Diagnostics.PerformanceCounter
untriaged
New issue has not been triaged by the area owner
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version]
Customer Support Team CSS got customer reporting this issue: We followed the doc: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecounter.nextvalue?view=net-8.0 to read Perf counter "HTTP Service Request Queues" MaxQueueItemAge.
The Code and the doc is quite clear and it works for other Perf Counters, except this "HTTP Service Request Queues" MaxQueueItemAge.
static void InitPerfCountersMeasure()
{
var perfCateogry = new PerformanceCounterCategory(@"HTTP Service Request Queues");
maxQueueAgeCounter = new PerformanceCounter(@"HTTP Service Request Queues", "MaxQueueItemAge", "Johnson Controls Rewrite", true); // this Perf counter does not work
Console.WriteLine($"initial value: {maxQueueAgeCounter.NextValue()}");
queueSizeCounter = new PerformanceCounter(@"HTTP Service Request Queues", "CurrentQueueSize", "Johnson Controls Rewrite", true); // this Perf Counter works no issue
origMaxQueueAge = maxQueueAgeCounter.NextSample();
perfCounterTimer = new System.Timers.Timer(1000);
//perfCounterTimer.AutoReset = false;
perfCounterTimer.Elapsed += PerfCountersMeasure;
perfCounterTimer.Start();
}
static void PerfCountersMeasure(object source, ElapsedEventArgs e)
{
//WriteLog("-----------------------------------------------");
WriteLog($"maxQueueAge: {maxQueueAgeCounter.NextValue()}");
WriteLog($"maxQueueAge orig raw value: {origMaxQueueAge.RawValue}");
WriteLog($"queueSize: {queueSizeCounter.NextValue()}");
WriteLog("-----------------------------------------------");
}
the QueueSize is increasing as the program keep sending requests there. but the "HTTP Service Request Queues" MaxQueueItemAge always got 0 back.
Original Comments
Feedback Bot on 12/09/2024, 02:32 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: