提交 7094e5e1 编写于 作者: Y youyong205

modify the send email

上级 458a897d
......@@ -21,13 +21,7 @@ public class AlertConfig {
}
public String buildMailTitle(ProductLine productLine, MetricItemConfig config) {
String title = "业务告警, 产品线[" + productLine.getTitle() + "], 业务指标[" + config.getTitle() + "]";
return title;
}
public String buildMailContent(ProductLine productLine, MetricItemConfig config) {
String title = "业务告警, 产品线[" + productLine.getTitle() + "], 业务指标[" + config.getTitle() + "]";
String title = "[业务告警] 产品线[" + productLine.getTitle() + "] 业务指标[" + config.getTitle() + "]";
return title;
}
......
......@@ -180,7 +180,7 @@ public class MetricAlert implements Task, LogEnabled {
}
if (alert != null && alert.getKey()) {
String content = "[ " + alert.getValue() + " ][ minute:" + (minute + 60) % 60 + " ][ time:"
+ m_sdf.format(new Date()) + "]";
+ m_sdf.format(new Date()) + "][ time:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:sss").format(new Date())+" ]" ;
sendAlertInfo(productLine, config, content);
......@@ -194,10 +194,7 @@ public class MetricAlert implements Task, LogEnabled {
int length = end - start + 1;
double[] result = new double[length];
System.arraycopy(baseline, start, result, 0, length);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(date) +" " + start +" " +end);
return result;
}
......
......@@ -19,7 +19,9 @@ public class DefaultGmailTest extends ComponentTestCase {
emails.add("yong.you@dianping.com");
String content = Files.forIO().readFrom(new File("/data/applogs/cat/cat_20140313.log"), "utf-8");
boolean result = mailsms.sendEmail("title", content, emails);
String title ="业务告警, 产品线[支付], 业务指标[创建订单]";
content = content +content;
boolean result = mailsms.sendEmail(title, content, emails);
Assert.assertEquals(true, result);
Thread.sleep(1000*5);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册