Created
February 15, 2013 09:11
-
-
Save sgomezvillamor/4959296 to your computer and use it in GitHub Desktop.
GangliaMetricsTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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