Skip to content

Instantly share code, notes, and snippets.

@sgomezvillamor
Created February 15, 2013 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgomezvillamor/4959296 to your computer and use it in GitHub Desktop.
Save sgomezvillamor/4959296 to your computer and use it in GitHub Desktop.
GangliaMetricsTest
package com.innoquant.analytics.engine.services;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.reporting.ConsoleReporter;
import com.yammer.metrics.reporting.GangliaReporter;
public class GangliaMetricsTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public final void test() throws InterruptedException {
GangliaReporter.enable(5, TimeUnit.SECONDS, "192.168.56.240", 8649);
ConsoleReporter.enable(5, TimeUnit.SECONDS);
Counter _metric = Metrics.newCounter(GangliaMetricsTest.class,
"counter");
for (int i = 0; i < 100000; i++) {
_metric.inc();
Thread.sleep(100);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment