Package io.dropwizard.metrics5
Class InstrumentedThreadFactory
java.lang.Object
io.dropwizard.metrics5.InstrumentedThreadFactory
- All Implemented Interfaces:
ThreadFactory
A
ThreadFactory that monitors the number of threads created, running and terminated.
It will register the metrics using the given (or auto-generated) name as classifier, e.g: "your-thread-delegate.created", "your-thread-delegate.running", etc.
-
Constructor Summary
ConstructorsConstructorDescriptionInstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry) Wraps aThreadFactory, uses a default auto-generated name.InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name) Wraps aThreadFactorywith an explicit name. -
Method Summary
-
Constructor Details
-
InstrumentedThreadFactory
Wraps aThreadFactory, uses a default auto-generated name.- Parameters:
delegate-ThreadFactoryto wrap.registry-MetricRegistrythat will contain the metrics.
-
InstrumentedThreadFactory
Wraps aThreadFactorywith an explicit name.- Parameters:
delegate-ThreadFactoryto wrap.registry-MetricRegistrythat will contain the metrics.name- name for this delegate.
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-