Bug 41294 - Some Mono threadpool performance counters return 0
Summary: Some Mono threadpool performance counters return 0
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: master
Hardware: PC All
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-05-24 16:33 UTC by Christopher Swiedler
Modified: 2018-01-05 13:32 UTC (History)
4 users (show)

Tags: bugpool-archive
Is this bug a regression?: ---
Last known good build:


Attachments
Sample code showing zeroed performance counters (549 bytes, text/plain)
2016-05-24 16:33 UTC, Christopher Swiedler
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Christopher Swiedler 2016-05-24 16:33:18 UTC
Created attachment 16091 [details]
Sample code showing zeroed performance counters

Some of the threadpool counters at http://www.mono-project.com/archived/mono_performance_counters/#category-mono-threadpool always return zero values. I can create the performance counters, but they never return correct values. The ones I've gotten this with are:

Work Items Added
Work Items Added/Sec
IO Work Items Added
IO Work Items Added/Sec

Sample code attached. Under mono 3.12, the work items added counter returns 10. Under mono 4.2.3, it returns 0.
Comment 1 Alex Rønne Petersen 2016-08-29 09:08:17 UTC
I can confirm that these counters don't get incremented. Probably an oversight when switching to the Microsoft thread pool code. Repro:

> using System;
> using System.Diagnostics;
> using System.Threading;
> class Program {
>     static void Main () {
>         var ctr = new PerformanceCounter ("Mono Threadpool", "Work Items Added");
>         for (var i = 0; i < 1024; i++)
>             ThreadPool.QueueUserWorkItem (_ => {});
>         Console.WriteLine (ctr.NextValue ());
>     }
> }


NEW -> ASSIGNED as Ludovic is assigned.
Comment 2 Ludovic Henry 2017-02-08 20:55:22 UTC
We acknowledge this enhancement request, therefore marked it as CONFIRMED.
However this does not necessarily mean we will take actions on it as we still need to discuss its feasibility internally and make sure it is not conflicting with other features.