Package com.dianping.cat.service

Examples of com.dianping.cat.service.ModelRequest


  public MetricReport queryCdnReport(String product, Map<String, String> properties, Date start) {
    long time = start.getTime();
    ModelPeriod period = ModelPeriod.getByTime(time);

    if (period == ModelPeriod.CURRENT || period == ModelPeriod.LAST) {
      ModelRequest request = new ModelRequest(product, time);

      request.getProperties().putAll(properties);

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


  public MetricReport queryMetricReport(String product, Date start) {
    long time = start.getTime();
    ModelPeriod period = ModelPeriod.getByTime(time);

    if (period == ModelPeriod.CURRENT || period == ModelPeriod.LAST) {
      ModelRequest request = new ModelRequest(product, time);

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

  public MetricReport querySystemReport(String product, Map<String, String> properties, Date start) {
    long time = start.getTime();
    ModelPeriod period = ModelPeriod.getByTime(time);

    if (period == ModelPeriod.CURRENT || period == ModelPeriod.LAST) {
      ModelRequest request = new ModelRequest(product, time);

      request.getProperties().putAll(properties);

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

  public MetricReport queryUserMonitorReport(String product, Map<String, String> properties, Date start) {
    long time = start.getTime();
    ModelPeriod period = ModelPeriod.getByTime(time);

    if (period == ModelPeriod.CURRENT || period == ModelPeriod.LAST) {
      ModelRequest request = new ModelRequest(product, time);

      request.getProperties().putAll(properties);

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

      Transaction t = Cat.newTransaction(DEPENDENCY, "FetchReport");

      try {
        for (String temp : domains) {
          try {
            ModelRequest request = new ModelRequest(temp, ModelPeriod.CURRENT.getStartTime()).setProperty("date",
                  String.valueOf(currentHour));
            if (m_service.isEligable(request)) {
              ModelResponse<DependencyReport> response = m_service.invoke(request);
              DependencyReport report = response.getModel();
View Full Code Here

    }
    return ip;
  }

  private HeartbeatReport getReport(String domain, String ipAddress, long date, ModelPeriod period) {
    ModelRequest request = new ModelRequest(domain, date) //
          .setProperty("ip", ipAddress);

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

    return data;
  }

  private EventReport getEventHourlyReport(String domain, String ip, String type) {
    ModelRequest request = new ModelRequest(domain, ModelPeriod.CURRENT.getStartTime()) //
          .setProperty("ip", ip);
    if (!StringUtils.isEmpty(type)) {
      request.setProperty("type", type);
    }

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

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

  private ProblemReport getProblemHourlyReport(String domain, String ip) {
    ModelRequest request = new ModelRequest(domain, ModelPeriod.CURRENT.getStartTime()) //
          .setProperty("type", "view");
    if (!ip.equalsIgnoreCase(Payload.ALL)) {
      request.setProperty("ip", ip);
    }

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

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

  private TransactionReport getTransactionHourlyReport(String domain, String ip, String type) {
    ModelRequest request = new ModelRequest(domain, ModelPeriod.CURRENT.getStartTime()) //
          .setProperty("ip", ip);
    if (!StringUtils.isEmpty(type)) {
      request.setProperty("type", type);
    }

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

  }

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

    if (m_service.isEligable(request)) {
      ModelResponse<CrossReport> response = m_service.invoke(request);
      CrossReport 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.