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());