Package com.dianping.cat.message.internal

Examples of com.dianping.cat.message.internal.DefaultMetric.addData()


  private Metric newMetric(String type, String name, long timestamp, String status, String data) {
    DefaultMetric Metric = new DefaultMetric(type, name);

    Metric.setStatus(status);
    Metric.addData(data);
    Metric.setTimestamp(timestamp);
    return Metric;
  }

  private Heartbeat newHeartbeat(String type, String name, long timestamp, String status, String data) {
View Full Code Here


      String metricData = helper.read(buf, TAB);

      helper.read(buf, LF); // get rid of line feed
      metric.setTimestamp(m_dateHelper.parse(timestamp));
      metric.setStatus(metricStatus);
      metric.addData(metricData);

      if (parent != null) {
        parent.addChild(metric);
        return parent;
      } else {
View Full Code Here

    Metric metric = Cat.getProducer().newMetric(group, key);
    DefaultMetric defaultMetric = (DefaultMetric) metric;

    defaultMetric.setTimestamp(timestamp);
    defaultMetric.setStatus("S,C");
    defaultMetric.addData(String.format("%s,%.2f", 1, duration));
  }

  private void logMetricForCount(long timestamp, String group, String key, int count) {
    Metric metric = Cat.getProducer().newMetric(group, key);
    DefaultMetric defaultMetric = (DefaultMetric) metric;
View Full Code Here

    DefaultMetric defaultMetric = (DefaultMetric) metric;

    defaultMetric.setTimestamp(timestamp);

    defaultMetric.setStatus("C");
    defaultMetric.addData(String.valueOf(count));
  }

  public boolean offer(MonitorEntity entity) {
    if (!StringUtils.isEmpty(entity.getTargetUrl())) {
      m_total++;
View Full Code Here

    DefaultMetric defaultMetric = (DefaultMetric) metric;

    defaultMetric.setTimestamp(time);
    if (MetricType.SUM.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("S,C");
      defaultMetric.addData(String.format("%s,%.2f", 1, value));
    } else if (MetricType.AVG.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("T");
      defaultMetric.addData(String.format("%.2f", value));
    } else if (MetricType.COUNT.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("C");
View Full Code Here

    if (MetricType.SUM.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("S,C");
      defaultMetric.addData(String.format("%s,%.2f", 1, value));
    } else if (MetricType.AVG.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("T");
      defaultMetric.addData(String.format("%.2f", value));
    } else if (MetricType.COUNT.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("C");
      defaultMetric.addData(String.valueOf(value));
    } else {
      throw new RuntimeException("Error type in metric api, type: " + type);
View Full Code Here

    } else if (MetricType.AVG.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("T");
      defaultMetric.addData(String.format("%.2f", value));
    } else if (MetricType.COUNT.name().equalsIgnoreCase(type)) {
      defaultMetric.setStatus("C");
      defaultMetric.addData(String.valueOf(value));
    } else {
      throw new RuntimeException("Error type in metric api, type: " + type);
    }

    MessageTree tree = Cat.getManager().getThreadLocalMessageTree();
View Full Code Here

      DefaultMetric metric = new DefaultMetric("City", "/beijing");

      metric.setTimestamp(m_timestamp + i * MINITE);
      metric.setStatus("S");
      metric.addData("10");

      t.addChild(metric);
      t.addChild(event);
    } else if (i % 3 == 1) {
      t = new DefaultTransaction("Service", "TuanGouWeb", null);
View Full Code Here

      DefaultMetric metric = new DefaultMetric("", "/nanjing");

      metric.setTimestamp(m_timestamp + i * MINITE);
      metric.setStatus("S,C");
      metric.addData("10,10");

      t.addChild(metric);
      t.addChild(event);
    } else {
      t = new DefaultTransaction("Metric", "TuanGouWeb", null);
View Full Code Here

      t.setTimestamp(m_timestamp + 1000);
      DefaultMetric metric = new DefaultMetric("", "/shanghai");

      metric.setTimestamp(m_timestamp + i * MINITE);
      metric.setStatus("C");
      metric.addData("10");

      t.addChild(metric);

      DefaultMetric durationMetric = new DefaultMetric("", "/shenzhen");

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.