@Override public void start() { reporter.start(10, TimeUnit.SECONDS); }
@Override public void start() { reporter.start(1, TimeUnit.SECONDS); }
@Override public void start() { if (reporter != null) { LOG.debug("Starting..."); reporter.start(10, TimeUnit.SECONDS); } else { throw new IllegalStateException("Attempt to start without preparing " + getClass().getSimpleName()); } }
/** * Create a {@link ConsoleReporter} attached to the Titan Metrics registry. * * @param reportInterval * time to wait between dumping metrics to the console */ public synchronized void addConsoleReporter(Duration reportInterval) { if (null != consoleReporter) { log.debug("Metrics ConsoleReporter already active; not creating another"); return; } consoleReporter = ConsoleReporter.forRegistry(getRegistry()).build(); consoleReporter.start(reportInterval.toMillis(), TimeUnit.MILLISECONDS); }
@Override public void start() { mReporter.start(getPollPeriod(), getPollUnit()); }
/** * Create a {@link ConsoleReporter} attached to the JanusGraph Metrics registry. * * @param reportInterval * time to wait between dumping metrics to the console */ public synchronized void addConsoleReporter(Duration reportInterval) { if (null != consoleReporter) { log.debug("Metrics ConsoleReporter already active; not creating another"); return; } consoleReporter = ConsoleReporter.forRegistry(getRegistry()).build(); consoleReporter.start(reportInterval.toMillis(), TimeUnit.MILLISECONDS); }
.convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(15, TimeUnit.SECONDS); reporters.add(reporter); scheduledReporters.add(reporter);
reporter.start(30, TimeUnit.SECONDS);
public static void main(String[] args) throws Exception { final MetricRegistry metrics = new MetricRegistry(); final HadoopMetrics2Reporter metrics2Reporter = HadoopMetrics2Reporter.forRegistry(metrics).build( DefaultMetricsSystem.initialize("StandaloneTest"), // The application-level name "Test", // Component name "Test", // Component description "Test"); // Name for each metric record final ConsoleReporter consoleReporter = ConsoleReporter.forRegistry(metrics).build(); MetricsSystem metrics2 = DefaultMetricsSystem.instance(); // Writes to stdout without a filename configuration // Will be invoked every 10seconds by default FileSink sink = new FileSink(); metrics2.register("filesink", "filesink", sink); sink.init(new SubsetConfiguration(null, null) { public String getString(String key) { if (key.equals("filename")) { return null; } return super.getString(key); } }); // How often should the dropwizard reporter be invoked metrics2Reporter.start(500, TimeUnit.MILLISECONDS); // How often will the dropwziard metrics be logged to the console consoleReporter.start(2, TimeUnit.SECONDS); generateMetrics(metrics, 5000, 25, TimeUnit.MILLISECONDS, metrics2Reporter, 10); }
/** * Create a {@link ConsoleReporter} attached to the {@code MetricsRegistry}. * * @param reportIntervalInMS milliseconds to wait between dumping metrics to the console */ public synchronized void addConsoleReporter(final long reportIntervalInMS) { if (null != consoleReporter) { log.debug("Metrics ConsoleReporter already active; not creating another"); return; } consoleReporter = ConsoleReporter.forRegistry(getRegistry()).build(); consoleReporter.start(reportIntervalInMS, TimeUnit.MILLISECONDS); log.info("Configured Metrics ConsoleReporter configured with report interval={}ms", reportIntervalInMS); }
@Override public void start() { reporter.start(1, TimeUnit.SECONDS); }
@Override public void start() { if (reporter != null) { LOG.debug("Starting..."); reporter.start(10, TimeUnit.SECONDS); } else { throw new IllegalStateException("Attempt to start without preparing " + getClass().getSimpleName()); } }
public static void main(String[] args) throws InterruptedException { MetricRegistry registry = new MetricRegistry(); ConsoleReporter reporter = ConsoleReporter.forRegistry(registry).build(); reporter.start(1, TimeUnit.SECONDS); registry.register(MetricRegistry.name(GaugeExample.class, "queue", "size"), (Gauge<Integer>) () -> q.size()); while (true) { Thread.sleep(1000); q.add("Job-xxx"); } } }
@Override public void createAndStartReporter(MetricRegistry metricRegistry, Map<String, Object> configuration) { ConsoleReporter reporter = ConsoleReporter.forRegistry(metricRegistry).build(); reporter.start(10, TimeUnit.SECONDS); } }
public static void main(String[] args) throws InterruptedException { MetricRegistry registry = new MetricRegistry(); ConsoleReporter reporter = ConsoleReporter.forRegistry(registry).build(); reporter.start(1, TimeUnit.SECONDS); Histogram histogram = new Histogram(new ExponentiallyDecayingReservoir()); registry.register(MetricRegistry.name(HistogramExample.class, "request", "histogram"), histogram); while (true) { Thread.sleep(1000); histogram.update(random.nextInt(100000)); } } }
/** * Sets up a ConsoleReporter, if not yet setup. */ public static void setupConsoleReporter(final long reportEveryMillis) { if (reporter == null) { reporter = ConsoleReporter.forRegistry(REGISTRY) .convertDurationsTo(TimeUnit.MILLISECONDS) .convertRatesTo(TimeUnit.SECONDS).build(); reporter.start(reportEveryMillis, TimeUnit.MILLISECONDS); } }
@Override public void report(MetricRegistry metricRegistry) { final ConsoleReporter reporter = ConsoleReporter.forRegistry(metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(1, TimeUnit.MINUTES); } }
private static ConsoleReporter startConsoleReporter(MetricRegistry registry) throws Exception { final ConsoleReporter reporter = ConsoleReporter .forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(1, TimeUnit.MINUTES); return reporter; } }
private static ConsoleReporter startConsoleReporter(MetricRegistry registry) throws Exception { final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry).convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS).build(); reporter.start(1, TimeUnit.MINUTES); return reporter; } }
@Override public void configureReporters(MetricRegistry metricRegistry) { if (configurationContext.isPrintStreams()) { ConsoleReporter.forRegistry(metricRegistry).build().start(5, TimeUnit.SECONDS); } if (configurationContext.isStatsEnabled()) { SiddhiStreamReporter.forRegistry(metricRegistry, streamOperationServiceWithoutMetrics()).build().start(5, TimeUnit.SECONDS); } JmxReporter.forRegistry(metricRegistry).build().start(); }