Examples of GMetricInteger


Examples of info.ganglia.metric.type.GMetricInteger

   * @return
   */
  public Metricable createGMetric(String host, String name, String type, String units, int slope, boolean clearValues) {
    Metricable gmetric = null;
    if (GMetric.VALUE_TYPE_INT.equals(type)) {
      gmetric = new GMetricInteger(host, name, type, units, slope, clearValues);
    } else if (GMetric.VALUE_TYPE_STRING.equals(type)) {
      gmetric = new GMetricString(host, name, type, units, slope, clearValues);
    } else if (GMetric.VALUE_TYPE_FLOAT.equals(type)) {
      gmetric = new GMetricFloat(host, name, type, units, slope, clearValues);
    } else if (GMetric.VALUE_TYPE_DOUBLE.equals(type)) {
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

    if (null == multicastAddress || multicastAddress.trim().equals("")) {
      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);
    }
  }
 
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testMetricTypeConstructor() {
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS, 30l);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testMetricTypeConstructor5() {
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS, 30l);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", "INVALID_TYPE", "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IllegalArgumentException e) {
      assertTrue(true);
    } catch (Exception e) {
      fail();
    }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  public void testUpdateInt() {
    int value = 10;
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS, 30l);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
      testMetric.incrementValue(value);
      testMetric.incrementValue();
      testMetric.setValue(value);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testConstructor() {
    try {
      GMonitor gmon = new GMonitor();
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testConstructor2() {
    try {
      GMonitor gmon = new GMonitor(30l);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testConstructor3() {
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of info.ganglia.metric.type.GMetricInteger

  @Test
  @SuppressWarnings("unused")
  public void testConstructor4() {
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS, 30l);
      GMetricInteger testMetric = (GMetricInteger) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_INT, "count", GMetric.SLOPE_UNSPECIFIED, true);
    } catch (IOException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.