MonitorFrequency.java
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.ecar.apm.model;
public enum MonitorFrequency {
//5秒
//FIVE(5, "0/5 * * * * ?", "5秒"),
//10秒
//TEN(10, "0/10 * * * * ?", "10秒"),
//20秒
//TWENTY(20, "0/20 * * * * ?", "20秒"),
//30秒
THIRTY(30, "0/30 * * * * ?", "30秒"),
//1分钟
SIXTY(60, "0 0/1 * * * ?", "1分钟"),
//2分钟
//TWO_MINUTES(120, "0 0/2 * * * ?", "2分钟"),
//3分钟
//THREE_MINUTES(180, "0 0/3 * * * ?", "3分钟"),
//5分钟
FIVE_MINUTES(300, "0 0/5 * * * ?", "5分钟"),
//10分钟
///TEN_MINUTES(600, "0 0/10 * * * ?", "10分钟"),
//30分钟
THIRTY_MINUTES(1800, "0 0/30 * * * ?", "30分钟"),
//1小时
ONE_HOUR(3600, "0 0 0/1 * * ?", "1小时");
//时间,秒
private int seconds;
//cron表达式
private String cronExpression;
//标记
private String label;
private MonitorFrequency(int seconds, String cronExpression, String label) {
this.seconds = seconds;
this.cronExpression = cronExpression;
this.label = label;
}
public int getSeconds() {
return seconds;
}
// second -> milli second
public int getMilliSeconds() {
return seconds * 1000;
}
public String getValue() {
return name();
}
public String getLabel() {
return label;
}
public String getCronExpression() {
return cronExpression;
}
}