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

Adds ability to exclude deadlocked threads from exported metrics #612

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

askoog
Copy link

@askoog askoog commented Jan 13, 2021

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.
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]>
@askoog askoog force-pushed the optional-deadlocked-threads-metric branch from ffa9616 to 1afba44 Compare January 13, 2021 12:58
Copy link
Contributor

@brian-brazil brian-brazil left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs locking.

Copy link
Author

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?

Copy link
Contributor

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.

@askoog
Copy link
Author

askoog commented Jan 13, 2021

How would the user access the object to call this?

I suppose you need to do instantiate the ThreadExports class directly, instead of just calling DefaultExports.register()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants