Package com.dianping.cat.home.rule.entity

Examples of com.dianping.cat.home.rule.entity.MetricItem


    for (Rule rule : rules) {
      String id = rule.getId();
      List<MetricItem> items = rule.getMetricItems();

      if (items.size() > 0) {
        MetricItem item = items.get(0);
        String productText = item.getProductText();
        String metricText = item.getMetricItemText();
        RuleItem ruleItem = new RuleItem(id, productText, metricText);

        ruleItem.setMonitorCount(item.isMonitorCount());
        ruleItem.setMonitorAvg(item.isMonitorAvg());
        ruleItem.setMonitorSum(item.isMonitorSum());

        ruleItems.add(ruleItem);
      }
    }
    model.setRuleItems(ruleItems);
View Full Code Here


    return config;
  }

  private Rule buildDefaultRule(String product, String metricKey) {
    Rule rule = new Rule(metricKey);
    MetricItem item = new MetricItem();

    item.setProductText(product);
    item.setMetricItemText(metricKey);

    MetricItemConfig metricItem = m_metricConfigManager.queryMetricItemConfig(metricKey);
    if (metricItem != null) {
      if (metricItem.isShowAvg()) {
        item.setMonitorAvg(true);
      }
      if (metricItem.isShowCount()) {
        item.setMonitorCount(true);
      }
      if (metricItem.isShowSum()) {
        item.setMonitorSum(true);
      }
    }

    rule.addMetricItem(item);
    rule.addConfig(buildDefaultConfig());
View Full Code Here

TOP

Related Classes of com.dianping.cat.home.rule.entity.MetricItem

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.