Package com.dianping.cat.service

Examples of com.dianping.cat.service.ModelRequest


    }
  }

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

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


    convertToDeltaArray(map, "CatMessageOverflow");
    return map;
  }

  private HeartbeatReport generateReport(String domain, long date) {
    ModelRequest request = new ModelRequest(domain, date);

    if (m_service.isEligable(request)) {
      ModelResponse<HeartbeatReport> response = m_service.invoke(request);

      return response.getModel();
View Full Code Here

    }
  }

  private Set<String> queryDomains() {
    Set<String> domains = new HashSet<String>();
    ModelRequest request = new ModelRequest("cat", System.currentTimeMillis());

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

    return cal.get(Calendar.HOUR_OF_DAY);
  }

  private ProblemReport getHourlyReport(Payload payload, String queryType) {
    String domain = payload.getDomain();
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("queryType", queryType);
    if (!Constants.ALL.equals(payload.getIpAddress())) {
      request.setProperty("ip", payload.getIpAddress());
    }
    if (!StringUtils.isEmpty(payload.getThreadId())) {
      request.setProperty("thread", payload.getThreadId());
    }
    if (!StringUtils.isEmpty(payload.getType())) {
      request.setProperty("type", payload.getType());
    }
    if (!StringUtils.isEmpty(payload.getStatus())) {
      request.setProperty("name", payload.getStatus());
    }
    if (m_service.isEligable(request)) {
      ModelResponse<ProblemReport> response = m_service.invoke(request);
      ProblemReport report = response.getModel();
      if (payload.getPeriod().isLast()) {
View Full Code Here

  private EventReport getEventGraphReport(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<EventReport> response = m_service.invoke(request);
    EventReport report = response.getModel();

View Full Code Here

  }

  private EventReport 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<EventReport> response = m_service.invoke(request);
View Full Code Here

  private ModelService<MatrixReport> m_service;

  private MatrixReport 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<MatrixReport> response = m_service.invoke(request);
      MatrixReport report = response.getModel();
View Full Code Here

  }

  private TopReport queryTopReport(Payload payload) {
    String domain = Constants.CAT;
    String date = String.valueOf(payload.getDate());
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("date", date);

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

  }

  @Override
  public Map<Object, Object> generateModel(String domain, Date endTime) {
    Map<Object, Object> result = new HashMap<Object, Object>();
    ModelRequest request = new ModelRequest(domain, getCurrentHour()).setProperty("queryType", "view");
    request.setProperty("type", "error");
    ProblemReport report = null;

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

  private String getLogView(String messageId, boolean waterfall) {
    try {
      if (messageId != null) {
        MessageId id = MessageId.parse(messageId);
        long timestamp = id.getTimestamp();
        ModelRequest request = new ModelRequest(id.getDomain(), timestamp) //
              .setProperty("messageId", messageId) //
              .setProperty("waterfall", String.valueOf(waterfall)) //
              .setProperty("timestamp", String.valueOf(timestamp));

        if (m_service.isEligable(request)) {
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.