Tabnine Logo
MetricsFactory.getTimer
Code IndexAdd Tabnine to your IDE (free)

How to use
getTimer
method
in
uk.gov.dstl.baleen.core.metrics.MetricsFactory

Best Java code snippets using uk.gov.dstl.baleen.core.metrics.MetricsFactory.getTimer (Showing top 9 results out of 315)

origin: dstl/baleen

/**
 * Get or create a new timer.
 *
 * @param name
 * @return
 */
public Timer getTimer(String name) {
 return factory.getTimer(base, name);
}
origin: uk.gov.dstl.baleen/baleen-core

/**
 * Get or create a new timer.
 *
 * @param name
 * @return
 */
public Timer getTimer(String name) {
 return factory.getTimer(base, name);
}
origin: uk.gov.dstl.baleen/baleen-core

/** 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();
}
origin: dstl/baleen

/** 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();
}
origin: dstl/baleen

@Test
public void testGetTimer() {
 Timer a = metrics.getTimer(MetricsFactoryTest.class, "a");
 assertNotNull(a);
 assertSame(a, metrics.getTimer(MetricsFactoryTest.class, "a"));
 assertNotEquals(a, metrics.getTimer(MetricsFactoryTest.class, "b"));
 Timer b = metrics.getTimer(MetricsFactoryTest.class.getCanonicalName(), "b");
 assertNotNull(b);
 assertSame(b, metrics.getTimer(MetricsFactoryTest.class.getCanonicalName(), "b"));
 assertNotEquals(b, metrics.getTimer(MetricsFactoryTest.class.getCanonicalName(), "c"));
}
origin: dstl/baleen

@Test
public void testGetTimer() {
 metrics.getTimer("timer");
 verify(factory).getTimer(anyString(), eq("timer"));
}
origin: dstl/baleen

@Test
public void testRemove() {
 metrics.getCounter(MetricsFactoryTest.class, "removeC");
 metrics.getTimer(MetricsFactoryTest.class, "removeT");
 metrics.getHistogram(MetricsFactoryTest.class, "removeH");
 metrics.getMeter(MetricsFactoryTest.class, "removeM");
 assertFalse(metrics.getRegistry().getMetrics().isEmpty());
 metrics.removeAll();
 assertTrue(metrics.getRegistry().getMetrics().isEmpty());
}
origin: dstl/baleen

 @Test
 public void test() throws Exception {
  PipelineMetrics pm = MetricsFactory.getInstance().getPipelineMetrics(PIPELINE_NAME);

  assertEquals(PIPELINE_NAME, pm.getPipelineName());

  pm.startDocumentProcess();
  Thread.sleep(10);
  pm.finishDocumentProcess();

  Timer t = MetricsFactory.getInstance().getTimer(PIPELINE_NAME, "documentProcessingTime");
  assertEquals(1, t.getCount());
  assertTrue(t.getMeanRate() > 0);

  assertEquals(pm, MetricsFactory.getInstance().getPipelineMetrics(PIPELINE_NAME));
 }
}
origin: dstl/baleen

@Test
public void testDoesntCrash() {
 MetricsFactory factory = MetricsFactory.getInstance();
 factory.getRegistry().addListener(new LoggingMetricListener());
 assertNotNull(factory.getCounter(LoggingMetricListenerTest.class, "a"));
 assertNotNull(factory.getHistogram(LoggingMetricListenerTest.class, "b"));
 assertNotNull(factory.getMeter(LoggingMetricListenerTest.class, "c"));
 assertNotNull(factory.getTimer(LoggingMetricListenerTest.class, "d"));
 factory.removeAll();
}
uk.gov.dstl.baleen.core.metricsMetricsFactorygetTimer

Javadoc

Get or create a metric timer, with default naming.

Popular methods of MetricsFactory

  • getMetrics
    Get a new metrics provider for a specific class.
  • getInstance
    Get singleton instance
  • configure
    Configure the instance.
  • getCounter
    Get or create a metric counter, with default naming.
  • getHistogram
    Get or create a metric histogram, with default naming.
  • getMeter
    Get or create a metric meter, with default naming.
  • getPipelineMetrics
    Get an instance of PipelineMetrics for the given pipeline name
  • getRegistry
    Get the underlying metrics registry.
  • makeName
    Create a name using the default scheme.
  • removeAll
    Remove all metrics from the registry
  • start
  • stop
  • start,
  • stop,
  • <init>,
  • report

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • String (java.lang)
  • Path (java.nio.file)
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now