Package org.apache.bookkeeper.stats
Class ThreadRegistry
java.lang.Object
org.apache.bookkeeper.stats.ThreadRegistry
For mapping thread ids to thread pools and threads within those pools
or just for lone named threads. Thread scoped metrics add labels to
metrics by retrieving the ThreadPoolThread object from this registry.
For flexibility, this registry is not based on TLS.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classStores the thread pool and ordinal. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static voidforceClearRegistrationForTests(long threadId) In some tests we run in the same thread activities that should run in different threads from different thread-pools this would trigger assertions to fail.get()static voidstatic voidstatic voidstatic voidstatic RunnableregisterThread(Runnable runnable, String threadPool)
-
Constructor Details
-
ThreadRegistry
public ThreadRegistry()
-
-
Method Details
-
register
-
register
-
forceClearRegistrationForTests
public static void forceClearRegistrationForTests(long threadId) In some tests we run in the same thread activities that should run in different threads from different thread-pools this would trigger assertions to fail. This is a convenience method to work around such cases. This method shouldn't be used in production code. -
register
-
register
-
registerThread
-
clear
public static void clear() -
get
-