/** * Get a new metrics provider for a specific class, without a prefix. * * @param clazz * @return */ public static Metrics getMetrics(Class<?> clazz) { return new Metrics(getInstance(), clazz); }
/** * Get the timer metric with the supplied name, within the scope of this monitor. * * @param name the name of the timer * @return the timer */ public Timer timer(String name) { return metrics.getTimer(name); }
/** * New instance with default naming for metrics entries. * * @param logger * @param clazz */ public AbstractApiServlet(Logger logger, Class<?> clazz) { this(logger, MetricsFactory.getMetrics("web", clazz)); }
/** Start timing the processing of a document */ public void startDocumentProcess() { finishDocumentProcess(); // Check we've finished the timing of the previous document documentTimerContext = MetricsFactory.getInstance().getTimer(pipelineName, DOCUMENT_TIMER).time(); }
/** * Get the counter metric with the supplied name, within the scope of this monitor. * * @param name the name of the counter * @return the counter */ public Counter counter(String name) { return metrics.getCounter(name); }
/** * Get or create a new timer. * * @param name * @return */ public Timer getTimer(String name) { return factory.getTimer(base, name); }
/** * Get or create a new meter. * * @param name * @return */ public Meter getMeter(String name) { return factory.getMeter(base, name); }
/** * Get or create a new counter. * * @param name * @return */ public Counter getCounter(String name) { return factory.getCounter(base, name); }
/** * Get or create a new histogram. * * @param name * @return */ public Histogram getHistogram(String name) { return factory.getHistogram(base, name); }
/** Force send metrics to the reporters (out of scheduled time) */ public void report() { for (ConfiguredReporter reporter : reporters) { reporter.report(); } } }
/** * Get a new metrics provider for a specific class. * * @param prefix * @param clazz * @return */ public static Metrics getMetrics(String prefix, Class<?> clazz) { return new Metrics(getInstance(), prefix, clazz); }
/** Start timing the processing of a document */ public void startDocumentProcess() { finishDocumentProcess(); // Check we've finished the timing of the previous document documentTimerContext = MetricsFactory.getInstance().getTimer(pipelineName, DOCUMENT_TIMER).time(); }
/** * New instance with default naming for metrics entries. * * @param logger * @param clazz */ public AbstractApiServlet(Logger logger, Class<?> clazz) { this(logger, MetricsFactory.getMetrics("web", clazz)); }
/** * Get the histogram metric with the supplied name, within the scope of this monitor. * * @param name the name of the histogram * @return the histogram */ public Counter histogram(String name) { return metrics.getCounter(name); }
/** * Get or create a new timer. * * @param name * @return */ public Timer getTimer(String name) { return factory.getTimer(base, name); }
/** * Get or create a new meter. * * @param name * @return */ public Meter getMeter(String name) { return factory.getMeter(base, name); }
/** * Get a new metrics provider for a specific class, without a prefix. * * @param clazz * @return */ public static Metrics getMetrics(Class<?> clazz) { return new Metrics(getInstance(), clazz); }
/** * Get a new metrics provider for a specific class. * * @param prefix * @param clazz * @return */ public static Metrics getMetrics(String prefix, Class<?> clazz) { return new Metrics(getInstance(), prefix, clazz); }