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 aThreadFactory
with an explicit name. -
Method Summary
-
Constructor Details
-
InstrumentedThreadFactory
Wraps aThreadFactory
, uses a default auto-generated name.- Parameters:
delegate
-ThreadFactory
to wrap.registry
-MetricRegistry
that will contain the metrics.
-
InstrumentedThreadFactory
Wraps aThreadFactory
with an explicit name.- Parameters:
delegate
-ThreadFactory
to wrap.registry
-MetricRegistry
that will contain the metrics.name
- name for this delegate.
-
-
Method Details
-
newThread
- Specified by:
newThread
in interfaceThreadFactory
-