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

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

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

origin: dstl/baleen

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

/**
 * Get or create a new counter.
 *
 * @param name
 * @return
 */
public Counter getCounter(String name) {
 return factory.getCounter(base, name);
}
origin: dstl/baleen

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

@Test
public void testGetCounter() {
 metrics.getCounter("counter");
 verify(factory).getCounter(anyString(), eq("counter"));
}
origin: dstl/baleen

 @Test
 public void testConfiguration() throws Exception {
  YamlConfiguration configuration =
    new YamlConfiguration(MetricsFactoryTest.class, "reporters.yaml");
  metrics.configure(configuration);

  metrics.start();

  try {
   metrics.getCounter(MetricsFactoryTest.class, "testConfiguration").inc();

   metrics.getCounter(MetricsFactoryTest.class, "testConfiguration").inc();

   MetricsFactory.getMetrics("test", MetricsFactoryTest.class)
     .getCounter("testConfigurationMetric")
     .inc();

   metrics.report();

   Thread.sleep(1000);
  } finally {
   metrics.stop();
  }

  // Delete the directory of CSV tests

  TestingUtils.deleteDirectory("test_csvmetrics");
 }
}
origin: dstl/baleen

@Test
public void testComponents() throws BaleenException, IOException {
 metrics.configure(new YamlConfiguration());
 metrics.start();
 metrics.getCounter(MetricsFactoryTest.class, "removeC");
 metrics.stop();
 assertTrue(metrics.getRegistry().getMetrics().isEmpty());
}
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 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.metricsMetricsFactorygetCounter

Javadoc

Get or create a metric counter, 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.
  • 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.
  • getTimer
    Get or create a metric timer, with default naming.
  • makeName
    Create a name using the default scheme.
  • removeAll
    Remove all metrics from the registry
  • start
  • stop
  • start,
  • stop,
  • <init>,
  • report

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JLabel (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
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