java.lang.Object
io.jooby.metrics.MetricsModule
- All Implemented Interfaces:
io.jooby.Extension
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newMetricsModule.MetricsModule(com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry) Creates a newMetricsModule.MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry) Creates a newMetricsModule.MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry) Creates a newMetricsModule.MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry, String pattern) Creates a newMetricsModule.MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry, String pattern) Creates a newMetricsModule.MetricsModule(String pattern) Creates a newMetricsModule. -
Method Summary
Modifier and TypeMethodDescriptionhealthCheck(String name, com.codahale.metrics.health.HealthCheck check) Append a health check to theHealthCheckRegistry.<H extends com.codahale.metrics.health.HealthCheck>
MetricsModulehealthCheck(String name, Class<H> check) Append a health check to theHealthCheckRegistry.voidinstall(io.jooby.Jooby application) Append a metric to theMetricRegistry, this call is identical toMetricRegistry.register(String, Metric).<M extends com.codahale.metrics.Metric>
MetricsModuleAppend a metric to theMetricRegistry.ping()Append a simple ping handler that results in a200responses with apongbody.reporter(BiFunction<com.codahale.metrics.MetricRegistry, com.typesafe.config.Config, com.codahale.metrics.Reporter> callback) Append aReporterto theMetricRegistry.Append aReporterto theMetricRegistry.Append a handler that prints thread states (a.k.a thread dump).Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jooby.Extension
lateinit
-
Constructor Details
-
MetricsModule
public MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry, String pattern) Creates a newMetricsModule.- Parameters:
metricRegistry- Use the given metricRegistry.healthCheckRegistry- Use the given healthCheckRegistry.pattern- A root pattern where to publish all the services. Default is:/sys.
-
MetricsModule
public MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry) Creates a newMetricsModule.- Parameters:
metricRegistry- Use the given metricRegistry.healthCheckRegistry- Use the given healthCheckRegistry.
-
MetricsModule
Creates a newMetricsModule.- Parameters:
metricRegistry- Use the given metricRegistry.pattern- A root pattern where to publish all the services. Default is:/sys.
-
MetricsModule
Creates a newMetricsModule.- Parameters:
pattern- A root pattern where to publish all the services. Default is:/sys.
-
MetricsModule
public MetricsModule(com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry) Creates a newMetricsModule. Services will be available at:/sys.- Parameters:
healthCheckRegistry- Use the given healthCheckRegistry.
-
MetricsModule
public MetricsModule(com.codahale.metrics.MetricRegistry metricRegistry) Creates a newMetricsModule. Services will be available at:/sys.- Parameters:
metricRegistry- Use the given metricRegistry.
-
MetricsModule
public MetricsModule()Creates a newMetricsModule. Services will be available at:/sys.
-
-
Method Details
-
ping
- Returns:
- This metrics module.
-
threadDump
Append a handler that prints thread states (a.k.a thread dump). SeeThreadDumpHandler.- Returns:
- This metrics module.
-
metric
Append a metric to theMetricRegistry, this call is identical toMetricRegistry.register(String, Metric).- Parameters:
name- Name of the metric.metric- A metric object- Returns:
- This metrics module.
-
metric
Append a metric to theMetricRegistry. The metric will be resolved by Guice. This call is identical toMetricRegistry.register(String, Metric).- Type Parameters:
M- Metric type.- Parameters:
name- Name of the metric.metric- A metric object.- Returns:
- This metrics module.
-
healthCheck
Append a health check to theHealthCheckRegistry. This call is identical toHealthCheckRegistry.register(String, HealthCheck).- Parameters:
name- Name of the check.check- A check object.- Returns:
- This metrics module.
-
healthCheck
public <H extends com.codahale.metrics.health.HealthCheck> MetricsModule healthCheck(String name, Class<H> check) Append a health check to theHealthCheckRegistry. The metric will be resolved by Guice. This call is identical toHealthCheckRegistry.register(String, HealthCheck).- Type Parameters:
H-HealthChecktype.- Parameters:
name- Name of the check.check- A check object.- Returns:
- This metrics module.
-
reporter
public MetricsModule reporter(BiFunction<com.codahale.metrics.MetricRegistry, com.typesafe.config.Config, com.codahale.metrics.Reporter> callback) Append aReporterto theMetricRegistry.- Parameters:
callback- Reporter callback.- Returns:
- This metrics module.
-
reporter
public MetricsModule reporter(Function<com.codahale.metrics.MetricRegistry, com.codahale.metrics.Reporter> callback) Append aReporterto theMetricRegistry.- Parameters:
callback- Reporter callback.- Returns:
- This metrics module.
-
install
public void install(@NonNull io.jooby.Jooby application) - Specified by:
installin interfaceio.jooby.Extension
-