Examples of GMetricDouble


Examples of info.ganglia.metric.type.GMetricDouble

    } 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)) {
      gmetric = new GMetricDouble(host, name, type, units, slope, clearValues);
    } else {
      throw new IllegalArgumentException("unknown metric type");
    }
    gmetrics.add(gmetric);
    sendGMetricInit(gmetric);
View Full Code Here

Examples of info.ganglia.metric.type.GMetricDouble

      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.GMetricDouble

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

Examples of info.ganglia.metric.type.GMetricDouble

  @Test
  public void testUpdateDouble() {
    double value = 10.50;
    try {
      GMonitor gmon = new GMonitor(MULTICAST_ADDRESS, 30l);
      GMetricDouble testMetric = (GMetricDouble) gmon.createGMetric(host, "Ganglia Test", GMetric.VALUE_TYPE_DOUBLE, "count", GMetric.SLOPE_UNSPECIFIED, true);
      testMetric.incrementValue(value);
      testMetric.incrementValue();
      testMetric.setValue(value);
    } 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.