Package com.dianping.cat.consumer.metric.model.entity

Examples of com.dianping.cat.consumer.metric.model.entity.MetricReport.accept()


        byte[] content = report.getContent();

        try {
          MetricReport reportModel = DefaultNativeParser.parse(content);

          reportModel.accept(merger);
        } catch (Exception e) {
          Cat.logError(e);
          Cat.getProducer().logEvent("ErrorXML", MetricAnalyzer.ID, Event.SUCCESS,
                report.getProductLine() + " " + report.getPeriod() + " " + report.getId());
        }
View Full Code Here


      return null;
    } else {
      MetricReportMerger merger = new MetricReportMerger(new MetricReport(request.getDomain()));

      for (MetricReport report : reports) {
        report.accept(merger);
      }
      return merger.getMetricReport();
    }
  }
View Full Code Here

    MetricReportMerger merger = new MetricReportMerger(new MetricReport(request.getDomain()));

    for (ModelResponse<MetricReport> response : responses) {
      MetricReport model = response.getModel();
      if (model != null) {
        model.accept(merger);
      }
    }

    return merger.getMetricReport();
  }
View Full Code Here

    MetricReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("MetricReportMergeResult.xml"), "utf-8");
    MetricReportMerger merger = new MetricReportMerger(new MetricReport(reportOld.getProduct()));

    reportOld.accept(merger);
    reportNew.accept(merger);

    Assert.assertEquals("Check the merge result!", expected.replaceAll("\\r", ""), merger.getMetricReport().toString().replaceAll("\\r", ""));
    Assert.assertEquals("Source report is changed!", newXml.replaceAll("\\r", ""), reportNew.toString().replaceAll("\\r", ""));
  }
View Full Code Here

     
      if (Monitor.TYPE_INFO.equals(type)) {
        Map<String, double[]> currentValues = fetchMetricInfoData(report);

        mergeMap(sourceValue, currentValues, totalSize, index);
        report.accept(merger);
      } else {
        Map<String, double[]> currentValues = fetchMetricCodeInfo(report);

        mergeMap(sourceValue, currentValues, totalSize, index);
      }
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.