System.out.println("Usage: java -jar GangliaMetrics.jar <multicast address>");
return;
}
GMonitor gmon = new GMonitor(multicastAddress, 30l);
GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Int Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, false);
GMetricDouble testMetric2 = (GMetricDouble) gmon.createGMetric(host, "Ganglia Double Test ", GMetric.VALUE_TYPE_DOUBLE, "count2", GMetric.SLOPE_UNSPECIFIED, false);
Random generator = new Random();
int count = 0;
double countDouble = 0;
while(true) {
Thread.sleep(5000);
count = generator.nextInt(100);
countDouble = generator.nextDouble() * 100;
System.out.println(count);
System.out.println(countDouble);
testMetric.incrementValue(count);
testMetric2.incrementValue(countDouble);
}
}