-
Notifications
You must be signed in to change notification settings - Fork 798
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
Adds ability to exclude deadlocked threads from exported metrics #612
base: main
Are you sure you want to change the base?
Conversation
Finding deadlocked threads might be an expensive operation if there are a large number of threads in the jvm since it requires a safepoint.
Finding deadlocked threads might be an expensive operation if there are a large number of threads in the jvm since it requires a safepoint. Signed-off-by: Andreas Skoog <[email protected]>
[email protected]:askoog/client_java.git into optional-deadlocked-threads-metric Signed-off-by: Andreas Skoog <[email protected]>
ffa9616
to
1afba44
Compare
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.
How would the user access the object to call this?
@@ -32,6 +32,7 @@ | |||
*/ | |||
public class ThreadExports extends Collector { | |||
private final ThreadMXBean threadBean; | |||
private boolean includeDeadlockedThreads = true; |
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.
This needs locking.
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.
Locking in what way? Better to set it in overloaded constructor?
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.
That's one option, this can be accessed and mutated concurrently which is the issue. You could also split this out to a completely separate collector.
I suppose you need to do instantiate the |
Finding deadlocked threads might be an expensive operation if there are
a large number of threads in the jvm since it requires a safepoint.