Package org.nuxeo.runtime.metrics
Class MetricsServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.runtime.metrics.MetricsServiceImpl
-
- All Implemented Interfaces:
MetricsService
,Adaptable
,Component
,Extensible
,TimestampedService
public class MetricsServiceImpl extends DefaultComponent implements MetricsService
-
-
Field Summary
Fields Modifier and Type Field Description protected io.dropwizard.metrics5.log4j2.InstrumentedAppender
appender
protected MetricsConfigurationDescriptor
config
protected static String
CONFIGURATION_EP
protected io.dropwizard.metrics5.Counter
instanceUp
protected io.dropwizard.metrics5.MetricRegistry
registry
protected static String
REPORTER_EP
protected List<MetricsReporterDescriptor>
reporterConfigs
protected List<MetricsReporter>
reporters
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description MetricsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ComponentContext context)
Activates the component.void
deactivate(ComponentContext context)
Deactivates the component.protected void
instrumentJvm(boolean activate)
protected void
instrumentLog4j(boolean activate)
protected void
instrumentTomcat(boolean activate)
protected boolean
metricEnabled()
protected void
registerTomcatGauge(String mbean, String attribute, io.dropwizard.metrics5.MetricRegistry registry, String name)
void
start(ComponentContext context)
Start the component.void
startReporters()
void
stop(ComponentContext context)
Stop the component.void
stopReporters()
protected void
updateInstrumentation(List<MetricsConfigurationDescriptor.InstrumentDescriptor> instruments, boolean activate)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
CONFIGURATION_EP
protected static final String CONFIGURATION_EP
- See Also:
- Constant Field Values
-
REPORTER_EP
protected static final String REPORTER_EP
- See Also:
- Constant Field Values
-
registry
protected io.dropwizard.metrics5.MetricRegistry registry
-
instanceUp
protected final io.dropwizard.metrics5.Counter instanceUp
-
config
protected MetricsConfigurationDescriptor config
-
reporterConfigs
protected List<MetricsReporterDescriptor> reporterConfigs
-
reporters
protected List<MetricsReporter> reporters
-
appender
protected io.dropwizard.metrics5.log4j2.InstrumentedAppender appender
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
stop
public void stop(ComponentContext context)
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
-
metricEnabled
protected boolean metricEnabled()
-
startReporters
public void startReporters()
- Specified by:
startReporters
in interfaceMetricsService
-
stopReporters
public void stopReporters()
- Specified by:
stopReporters
in interfaceMetricsService
-
updateInstrumentation
protected void updateInstrumentation(List<MetricsConfigurationDescriptor.InstrumentDescriptor> instruments, boolean activate)
-
instrumentLog4j
protected void instrumentLog4j(boolean activate)
-
registerTomcatGauge
protected void registerTomcatGauge(String mbean, String attribute, io.dropwizard.metrics5.MetricRegistry registry, String name)
-
instrumentTomcat
protected void instrumentTomcat(boolean activate)
-
instrumentJvm
protected void instrumentJvm(boolean activate)
-
-