Class MetricsReporterService
java.lang.Object
de.hybris.platform.metrics.dropwizard.MetricsReporterService
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class MetricsReporterService
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Manages the logging of metrics.
You can configure the following parameters of the custom metrics reporter service:
metrics.reporter.<reporterName>.enabled- defines whether reporting of metrics should be enabledmetrics.reporter.<reporterName>.filter.*- defines the SpEL expressions used to filter the names of metrics reported periodically. The way of handling the multiple filters defined in properties is defined by givenMetricsReporterFactoryimplementationmetrics.reporter.<reporterName>.period.seconds- defines the period (in seconds) how often metrics should be reported
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetricsReporterService(com.codahale.metrics.MetricRegistry registry, String reporterName, MetricsReporterFactory metricsReporterFactory) The constructor for the metric report service. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ScheduledExecutorServicecreateDefaultExecutor(String name, String tenantID) voiddestroy()boolean
-
Field Details
-
METRICS_REPORTER_ENABLED
- See Also:
-
METRICS_REPORTER_FILTER
- See Also:
-
METRICS_REPORTER_PERIOD_SECONDS
- See Also:
-
DEFAULT_METRICS_REPORTER_PERIOD_SECONDS_VALUE
-
DEFAULT_METRICS_REPORTER_FILTER_VALUE
- See Also:
-
-
Constructor Details
-
MetricsReporterService
public MetricsReporterService(com.codahale.metrics.MetricRegistry registry, String reporterName, MetricsReporterFactory metricsReporterFactory) The constructor for the metric report service. The service will check the config properties and manage the reporter (start/stop/update)- Parameters:
registry- the metric registry that should be used to report metricsreporterName- name of the reporter - it is used to determine the properties that will be used to configure the reportermetricsReporterFactory- the factory that will create the reporter any time it is required
-
-
Method Details
-
getReportingPeriod
-
isReporterEnabled
public boolean isReporterEnabled() -
getReporterFilters
-
createDefaultExecutor
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-