public class FastForwardReporter extends Object implements io.dropwizard.lifecycle.Managed
The String "name" of the Metric is sent as the 'what' attribute in the FastForward metric. No translation of the (possibly long, Java classname-ish) name is done. The type of metric is included in the 'metric_type' attribute.
For meters, timers, and histograms, the various component values of the
com.codahale.metrics.Metric (m1/m5/m15, p50, p99 etc) are sent as individual Metric
instances. The 'stat' attribute is filled out with the corresponding statistic.
Note that not every statistic from Meters/Timers/Histograms is sent to FastForward in order to limit the amount of data being sent and needing to be stored downstream. For Metered instances, only 1m and 5m is sent. For Histograms, just median, p75 and p99 (plus min/max/mean/stddev).
| Modifier and Type | Method and Description |
|---|---|
static FastForwardReporter |
create(com.codahale.metrics.MetricRegistry registry,
Optional<com.google.common.net.HostAndPort> address,
String metricKey,
int intervalSeconds)
Create a new FastForwardReporter instance.
|
static FastForwardReporter |
create(com.codahale.metrics.MetricRegistry registry,
Optional<com.google.common.net.HostAndPort> address,
String metricKey,
int intervalSeconds,
Supplier<Map<String,String>> additionalAttributes)
Overload of
create(MetricRegistry, Optional, String, int) which allows for setting
additional attributes in each reported metric. |
void |
start() |
void |
stop() |
public static FastForwardReporter create(com.codahale.metrics.MetricRegistry registry, Optional<com.google.common.net.HostAndPort> address, String metricKey, int intervalSeconds) throws SocketException, UnknownHostException
registry - MetricRegistry to report to ffwdaddress - Optional HostAndPort to override the defaults that ffwd client usesmetricKey - key to use for all metricsintervalSeconds - how often to report metrics to ffwdSocketExceptionUnknownHostExceptionpublic static FastForwardReporter create(com.codahale.metrics.MetricRegistry registry, Optional<com.google.common.net.HostAndPort> address, String metricKey, int intervalSeconds, Supplier<Map<String,String>> additionalAttributes) throws SocketException, UnknownHostException
create(MetricRegistry, Optional, String, int) which allows for setting
additional attributes in each reported metric.
The additional attributes are modeled as a Supplier to allow for attributes that might change values at runtime.
SocketExceptionUnknownHostExceptionpublic void start()
throws Exception
start in interface io.dropwizard.lifecycle.ManagedExceptionCopyright © 2017. All rights reserved.