Package io.dropwizard.metrics5
Class InstrumentedThreadFactory
- java.lang.Object
-
- io.dropwizard.metrics5.InstrumentedThreadFactory
-
- All Implemented Interfaces:
ThreadFactory
public class InstrumentedThreadFactory extends Object implements ThreadFactory
AThreadFactorythat 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
Constructors Constructor Description InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry)Wraps aThreadFactory, uses a default auto-generated name.InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name)Wraps aThreadFactorywith an explicit name.
-
-
-
Constructor Detail
-
InstrumentedThreadFactory
public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry)
Wraps aThreadFactory, uses a default auto-generated name.- Parameters:
delegate-ThreadFactoryto wrap.registry-MetricRegistrythat will contain the metrics.
-
InstrumentedThreadFactory
public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name)
Wraps aThreadFactorywith an explicit name.- Parameters:
delegate-ThreadFactoryto wrap.registry-MetricRegistrythat will contain the metrics.name- name for this delegate.
-
-
Method Detail
-
newThread
public Thread newThread(Runnable runnable)
- Specified by:
newThreadin interfaceThreadFactory
-
-