Skip to content

Conversation

@NickCraver
Copy link
Collaborator

I swear I already did this somewhere but it got lost, this adds additional thread pool stats exposed in .NET Core 3.1+. We'll get for example ThreadPool.PendingWorkItemCount on exception messages to better indicate app contention.

I swear I already did this somewhere but it got lost, this adds additional thread pool stats exposed in .NET Core 3.1+. We'll get for example ThreadPool.PendingWorkItemCount on exception messages to better indicate app contention.
@NickCraver NickCraver requested a review from mgravell January 25, 2022 02:54
worker = $"(Busy={busyWorkerThreads},Free={freeWorkerThreads},Min={minWorkerThreads},Max={maxWorkerThreads})";

#if NETCOREAPP
workItems = $"(Threads={ThreadPool.ThreadCount},QueuedItems={ThreadPool.PendingWorkItemCount},CompletedItems={ThreadPool.CompletedWorkItemCount})";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how often is this called? should I care about the string alloc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of how existing works - was light touch, let's get existing PRs touching it in, then I'll add a bench and do a builder pass and such on the exception path, no reason we can't be civilized with the GC!

@NickCraver
Copy link
Collaborator Author

@mgravell allocated in the exception path - I don't think it's a major item but would like to go through and end-to-end builder these paths once existing PRs are in (several touch it).

@NickCraver NickCraver merged commit b81c5da into main Jan 25, 2022
@NickCraver NickCraver deleted the craver/exception-threadpool-stats branch January 25, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants