Java Code Examples for com.yammer.metrics.core.Clock#defaultClock()
The following examples show how to use
com.yammer.metrics.core.Clock#defaultClock() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KafkaStatsdMetricsReporter.java From kafka-statsd-reporter with MIT License | 6 votes |
@Override public synchronized void stopReporter() { if (initialized && running) { reporter.shutdown(); running = false; LOG.info("Stopped Kafka Statsd metrics reporter"); try { reporter = new StatsdReporter( Metrics.defaultRegistry(), statsdGroupPrefix, predicate, statsdHost, statsdPort, Clock.defaultClock() ); } catch (IOException e) { LOG.error("Unable to initialize StatsdReporter", e); } } }
Example 2
Source File: KafkaGraphiteMetricsReporter.java From kafka-graphite with Apache License 2.0 | 6 votes |
private FilteredGraphiteReporter buildGraphiteReporter() { FilteredGraphiteReporter graphiteReporter = null; try { graphiteReporter = new FilteredGraphiteReporter( Metrics.defaultRegistry(), metricPrefix, metricPredicate, metricDimensions, new FilteredGraphiteReporter.DefaultSocketProvider(graphiteHost, graphitePort), Clock.defaultClock() ); } catch (IOException e) { LOG.error("Unable to initialize GraphiteReporter", e); } return graphiteReporter; }
Example 3
Source File: KafkaStatsdMetricsReporter.java From kafka-statsd-reporter with MIT License | 5 votes |
@Override public synchronized void init(VerifiableProperties props) { if (!initialized) { KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props); statsdHost = props.getString("kafka.statsd.metrics.host", STATSD_DEFAULT_HOST).trim(); statsdPort = props.getInt("kafka.statsd.metrics.port", STATSD_DEFAULT_PORT); statsdGroupPrefix = props.getString("kafka.statsd.metrics.group", STATSD_DEFAULT_PREFIX).trim(); String regex = props.getString("kafka.statsd.metrics.exclude.regex", null); LOG.debug("Initialize StatsdReporter ["+statsdHost+","+statsdPort+","+statsdGroupPrefix+"]"); if (regex != null) { predicate = new RegexMetricPredicate(regex); } try { reporter = new StatsdReporter( Metrics.defaultRegistry(), statsdGroupPrefix, predicate, statsdHost, statsdPort, Clock.defaultClock() ); } catch (IOException e) { LOG.error("Unable to initialize StatsdReporter", e); } if (props.getBoolean("kafka.statsd.metrics.reporter.enabled", false)) { initialized = true; startReporter(metricsConfig.pollingIntervalSecs()); LOG.debug("StatsdReporter started."); } } }
Example 4
Source File: CustomReporter.java From netty-4.1.22 with Apache License 2.0 | 4 votes |
/** * Creates a new {@link CustomReporter} for a given metrics registry. */ public CustomReporter(final MetricsRegistry metricsRegistry, final PrintStream out, final MetricPredicate predicate) { this(metricsRegistry, out, predicate, Clock.defaultClock(), TimeZone .getDefault()); }
Example 5
Source File: CustomReporter.java From netty4.0.27Learn with Apache License 2.0 | 4 votes |
/** * Creates a new {@link CustomReporter} for a given metrics registry. */ public CustomReporter(final MetricsRegistry metricsRegistry, final PrintStream out, final MetricPredicate predicate) { this(metricsRegistry, out, predicate, Clock.defaultClock(), TimeZone .getDefault()); }