-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Report ThreadPool stats #1399
Merged
Merged
Report ThreadPool stats #1399
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fdefa6d
Report ThreadPool stats
SimonCropp 8b3b0dd
Update CHANGELOG.md
SimonCropp 5825487
Merge branch 'main' into Report-ThreadPool-stats
bruno-garcia fce497c
Merge branch 'main' into Report-ThreadPool-stats
SimonCropp 1efae44
Merge branch 'main' into Report-ThreadPool-stats
SimonCropp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Text.Json; | ||
using Sentry.Extensibility; | ||
|
||
namespace Sentry | ||
{ | ||
internal sealed class ThreadPoolInfo : IJsonSerializable | ||
{ | ||
public ThreadPoolInfo( | ||
int minWorkerThreads, | ||
int minCompletionPortThreads, | ||
int maxWorkerThreads, | ||
int maxCompletionPortThreads, | ||
int availableWorkerThreads, | ||
int availableCompletionPortThreads) | ||
{ | ||
MinWorkerThreads = minWorkerThreads; | ||
MinCompletionPortThreads = minCompletionPortThreads; | ||
MaxWorkerThreads = maxWorkerThreads; | ||
MaxCompletionPortThreads = maxCompletionPortThreads; | ||
AvailableWorkerThreads = availableWorkerThreads; | ||
AvailableCompletionPortThreads = availableCompletionPortThreads; | ||
} | ||
|
||
public int MinWorkerThreads { get; } | ||
public int MinCompletionPortThreads { get; } | ||
public int MaxWorkerThreads { get; } | ||
public int MaxCompletionPortThreads { get; } | ||
public int AvailableWorkerThreads { get; } | ||
public int AvailableCompletionPortThreads { get; } | ||
|
||
public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger) | ||
{ | ||
writer.WriteStartObject(); | ||
|
||
writer.WriteNumber("minWorkerThreads", MinWorkerThreads); | ||
writer.WriteNumber("minCompletionPortThreads", MinCompletionPortThreads); | ||
writer.WriteNumber("maxWorkerThreads", MaxWorkerThreads); | ||
writer.WriteNumber("maxCompletionPortThreads", MaxCompletionPortThreads); | ||
writer.WriteNumber("availableWorkerThreads", AvailableWorkerThreads); | ||
writer.WriteNumber("availableCompletionPortThreads", AvailableCompletionPortThreads); | ||
|
||
writer.WriteEndObject(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bruno-garcia we only want that information for Events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgive my ignorance, where else would we have it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Lucas is referring to Transactions as the other possible place to add it.
We only run
SentryEvent
instances here so transactions won't be getting this information.A few things go through when deciding:
If the answer is 'yes' to both, it's a good candidate. Ideally we add information that's relative to the transaction itself (like what happened during the duration of that transaction). Like: How many GC gen0/1/2 ran during the transaction, for example. As 'point in time' information alone within a transaction might not be as valuable.
Ultimately, this might be more useful only as Metrics. Which is something we'll look into adding in the future