Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PerformanceCounter.NextValue() always return 0 for "HTTP Service Request Queues" MaxQueueItemAge #109956

Open
vsfeedback opened this issue Nov 19, 2024 · 1 comment
Labels
area-System.Diagnostics.PerformanceCounter untriaged New issue has not been triaged by the area owner

Comments

@vsfeedback
Copy link

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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 19, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 19, 2024
@vcsjones vcsjones added area-System.Diagnostics.PerformanceCounter and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Diagnostics.PerformanceCounter untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants