Package com.dianping.cat.service

Examples of com.dianping.cat.service.ModelRequest


      throw new RuntimeException("Internal error: no eligable cross service registered for " + request + "!");
    }
  }

  private CrossReport getHourlyReport(String domain, ModelPeriod period, String date, String ip) {
    ModelRequest request = new ModelRequest(domain, Long.parseLong(date)) //
          .setProperty("ip", ip);

    if (m_service.isEligable(request)) {
      ModelResponse<CrossReport> response = m_service.invoke(request);
View Full Code Here


      MetricReport report = m_currentReports.get(product);

      if (report != null) {
        return report;
      } else {
        ModelRequest request = new ModelRequest(product, ModelPeriod.CURRENT.getStartTime()).setProperty(
              "requireAll", "ture");

        report = m_service.invoke(request);
        if (report != null) {
          m_currentReports.put(product, report);
        }
        return report;
      }
    } else if (period == ModelPeriod.LAST) {
      MetricReport report = m_lastReports.get(product);

      if (report != null) {
        return report;
      } else {
        ModelRequest request = new ModelRequest(product, ModelPeriod.LAST.getStartTime()).setProperty("requireAll",
              "ture");

        report = m_service.invoke(request);
        if (report != null) {
          m_lastReports.put(product, report);
View Full Code Here

    return result;
  }

  private ProblemReport queryProblemReport(Payload payload, String domain) {
    String date = String.valueOf(payload.getDate());
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("date", date).setProperty("type", "view");
    if (m_problemservice.isEligable(request)) {
      ModelResponse<ProblemReport> response = m_problemservice.invoke(request);

      return response.getModel();
View Full Code Here

    try {
      String report = payload.getReport();
      String domain = payload.getDomain();
      ModelPeriod period = payload.getPeriod();
      ModelRequest request = null;

      if ("logview".equals(report)) {
        request = new ModelRequest(domain, MessageId.parse(payload.getMessageId()).getTimestamp());
      } else {
        request = new ModelRequest(domain, period.getStartTime());
      }
      ModelResponse<?> response = null;

      if (TransactionAnalyzer.ID.equals(report)) {
        response = m_transactionService.invoke(request);
      } else if (EventAnalyzer.ID.equals(report)) {
        response = m_eventService.invoke(request);
      } else if (ProblemAnalyzer.ID.equals(report)) {
        response = m_problemService.invoke(request);
      } else if ("logview".equals(report)) {
        String messageId = payload.getMessageId();
        MessageId id = MessageId.parse(messageId);

        request.setProperty("messageId", messageId);
        request.setProperty("waterfall", String.valueOf(payload.isWaterfall()));

        if (id.getVersion() != 1) {
          response = m_messageService.invoke(request);
        }
      } else if (HeartbeatAnalyzer.ID.equals(report)) {
View Full Code Here

  private EventReport getHourlyEventReport(Payload payload) {
    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    String type = payload.getType();
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("ip", ipAddress);
    EventReport eventReport = null;

    if (StringUtils.isEmpty(type)) {
      ModelResponse<EventReport> response = m_eventService.invoke(request);

      eventReport = response.getModel();
    } else {
      request.setProperty("type", type);
      ModelResponse<EventReport> response = m_eventService.invoke(request);

      eventReport = response.getModel();
    }
    if (Constants.ALL.equalsIgnoreCase(ipAddress)) {
View Full Code Here

  private TransactionReport getHourlyTransactionReport(Payload payload) {
    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    String type = payload.getType();
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("ip", ipAddress);
    TransactionReport transactionReport = null;

    if (StringUtils.isEmpty(type)) {
      ModelResponse<TransactionReport> response = m_transactionService.invoke(request);
      transactionReport = response.getModel();
    } else {
      request.setProperty("type", type);
      ModelResponse<TransactionReport> response = m_transactionService.invoke(request);
      transactionReport = response.getModel();
    }
    if (Constants.ALL.equalsIgnoreCase(ipAddress)) {
      MergeAllMachine all = new MergeAllMachine();
View Full Code Here

  }

  private TransactionReport getHourlyReport(Payload payload) {
    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    ModelRequest request = new ModelRequest(domain, payload.getDate()).setProperty("type", payload.getType())
          .setProperty("ip", ipAddress);

    if (m_service.isEligable(request)) {
      ModelResponse<TransactionReport> response = m_service.invoke(request);
      TransactionReport report = response.getModel();
View Full Code Here

  private TransactionReport getTransactionGraphReport(Model model, Payload payload) {
    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    String name = payload.getName();
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("type", payload.getType()) //
          .setProperty("name", payload.getName())//
          .setProperty("ip", ipAddress);

    if (name == null || name.length() == 0) {
      request.setProperty("name", "*");
      request.setProperty("all", "true");
      name = Constants.ALL;
    }
    ModelResponse<TransactionReport> response = m_service.invoke(request);
    TransactionReport report = response.getModel();
    return report;
View Full Code Here

  }

  private StateReport getHourlyReport(Payload payload) {
    // only for cat
    String domain = Constants.CAT;
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("ip", payload.getIpAddress());

    if (m_service.isEligable(request)) {
      ModelResponse<StateReport> response = m_service.invoke(request);
View Full Code Here

    return minute;
  }

  private DependencyReport queryDependencyReport(Payload payload) {
    String domain = payload.getDomain();
    ModelRequest request = new ModelRequest(domain, payload.getDate());

    if (m_dependencyService.isEligable(request)) {
      ModelResponse<DependencyReport> response = m_dependencyService.invoke(request);
      DependencyReport report = response.getModel();
View Full Code Here

TOP

Related Classes of com.dianping.cat.service.ModelRequest

Copyright © 2018 www.massapicom. 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.