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.InstrumentedAppenderappenderprotected MetricsConfigurationDescriptorconfigprotected static StringCONFIGURATION_EPprotected io.dropwizard.metrics5.CounterinstanceUpprotected io.dropwizard.metrics5.MetricRegistryregistryprotected static StringREPORTER_EPprotected List<MetricsReporterDescriptor>reporterConfigsprotected 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 voidactivate(ComponentContext context)Activates the component.voiddeactivate(ComponentContext context)Deactivates the component.protected voidinstrumentJvm(boolean activate)protected voidinstrumentLog4j(boolean activate)protected voidinstrumentTomcat(boolean activate)protected booleanmetricEnabled()protected voidregisterTomcatGauge(String mbean, String attribute, io.dropwizard.metrics5.MetricRegistry registry, String name)voidstart(ComponentContext context)Start the component.voidstartReporters()voidstop(ComponentContext context)Stop the component.voidstopReporters()protected voidupdateInstrumentation(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:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
public void stop(ComponentContext context)
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
metricEnabled
protected boolean metricEnabled()
-
startReporters
public void startReporters()
- Specified by:
startReportersin interfaceMetricsService
-
stopReporters
public void stopReporters()
- Specified by:
stopReportersin 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)
-
-