Package com.dianping.cat.service

Examples of com.dianping.cat.service.ModelPeriod


  }

  @Override
  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);
View Full Code Here


  }

  @Override
  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)) {
View Full Code Here

  }

  @Override
  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);
View Full Code Here

  }

  @Override
  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);
View Full Code Here

    }
    return graph;
  }

  private TopologyGraph queryTopologyGraph(long time) {
    ModelPeriod period = ModelPeriod.getByTime(time);

    if (period.isHistorical()) {
      return queryGraphFromDB(time);
    } else {
      return queryGraphFromMemory(time);
    }
  }
View Full Code Here

  public ModelResponse<T> invoke(ModelRequest request) {
    ModelResponse<T> response = new ModelResponse<T>();
    Transaction t = Cat.newTransaction("ModelService", getClass().getSimpleName());

    try {
      ModelPeriod period = request.getPeriod();
      String domain = request.getDomain();
      T report = getReport(request, period, domain);

      t.addData("period", period);
      t.addData("domain", domain);
View Full Code Here

    return response;
  }

  @Override
  public boolean isEligable(ModelRequest request) {
    ModelPeriod period = request.getPeriod();

    return !period.isHistorical();
  }
View Full Code Here

    model.setPage(ReportPage.MODEL);

    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);
View Full Code Here

  public ModelResponse<String> invoke(ModelRequest request) {
    ModelResponse<String> response = new ModelResponse<String>();
    Transaction t = Cat.newTransaction("ModelService", getClass().getSimpleName());

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

      response.setModel(report);
View Full Code Here

    return content;
  }

  @Override
  public boolean isEligable(ModelRequest request) {
    ModelPeriod period = request.getPeriod();

    if (period.isHistorical()) {
      long time = Long.parseLong(request.getProperty("timestamp"));
      long current = System.currentTimeMillis();
      long currentHour = current - current % TimeHelper.ONE_HOUR;

      if (time == currentHour - 2 * TimeHelper.ONE_HOUR) {
View Full Code Here

TOP

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

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.