本文整理汇总了Java中scouter.util.DateUtil.MILLIS_PER_MINUTE属性的典型用法代码示例。如果您正苦于以下问题:Java DateUtil.MILLIS_PER_MINUTE属性的具体用法?Java DateUtil.MILLIS_PER_MINUTE怎么用?Java DateUtil.MILLIS_PER_MINUTE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类scouter.util.DateUtil
的用法示例。
在下文中一共展示了DateUtil.MILLIS_PER_MINUTE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeepTime
private static long getKeepTime(byte timeType) {
switch (timeType) {
case TimeTypeEnum.REALTIME:
return 10000;
case TimeTypeEnum.ONE_MIN:
return DateUtil.MILLIS_PER_MINUTE + 3000;
case TimeTypeEnum.FIVE_MIN:
return DateUtil.MILLIS_PER_MINUTE * 5 + 3000;
case TimeTypeEnum.TEN_MIN:
return DateUtil.MILLIS_PER_MINUTE * 10 + 3000;
case TimeTypeEnum.HOUR:
return DateUtil.MILLIS_PER_HOUR + 3000;
default:
return 30 * 10000;
}
}
示例2: loadPrev5min
private void loadPrev5min() {
Iterator<Integer> serverIds = serverObjMap.keySet().iterator();
final List<Pack> result = new ArrayList<Pack>();
while (serverIds.hasNext()) {
int serverId = serverIds.next();
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
MapPack param = new MapPack();
long etime = TimeUtil.getCurrentTime();
long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
param.put("stime", stime);
param.put("etime", etime);
param.put("counter", counter);
param.put("objHash", serverObjMap.get(serverId));
tcp.process(RequestCmd.COUNTER_PAST_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
result.add(p);
}
});
} catch (Exception e) {
e.printStackTrace();
} finally {
TcpProxy.putTcpProxy(tcp);
}
}
final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, result, mode, TimeTypeEnum.REALTIME);
ExUtil.exec(canvas, new Runnable() {
public void run() {
CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();
provider.clearTrace();
Set<Long> timeSet = valueMap.keySet();
for (long time : timeSet) {
provider.addSample(new Sample(CastUtil.cdouble(time), CastUtil.cdouble(valueMap.get(time))));
}
}
});
}
示例3: getPrevTotalPerf
private void getPrevTotalPerf() {
final ArrayList<Pack> values = new ArrayList<Pack>();
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
long etime = TimeUtil.getCurrentTime(serverId);
long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
MapPack param = new MapPack();
param.put("stime", stime);
param.put("etime", etime);
param.put("objType", objType);
param.put("counter", counter);
tcp.process(RequestCmd.COUNTER_PAST_TIME_ALL, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack mpack = in.readPack();
values.add(mpack);
};
});
} catch (Throwable t) {
ConsoleProxy.errorSafe(t.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
}
final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, values, mode, TimeTypeEnum.REALTIME);
ExUtil.exec(this.canvas, new Runnable() {
public void run() {
traceDataProvider.clearTrace();
Set<Long> timeSet = valueMap.keySet();
for (long time : timeSet) {
double value = CastUtil.cdouble(valueMap.get(time));
traceDataProvider.addSample(new Sample(time, value));
}
}
});
}
示例4: setInput
public void setInput(long stime, long etime) {
if (loadQueryJob.getState() == Job.WAITING || loadQueryJob.getState() == Job.RUNNING) {
MessageDialog.openInformation(null, "STOP", "Previous loading is not yet finished");
return;
}
if (etime - stime < DateUtil.MILLIS_PER_MINUTE) {
stime = etime - DateUtil.MILLIS_PER_MINUTE;
}
root.clear();
this.stime = stime;
this.etime = etime;
this.date = DateUtil.yyyymmdd(stime);
loadQueryJob.schedule();
}
示例5: loadPrev5min
private void loadPrev5min() {
Iterator<Integer> serverIds = serverObjMap.keySet().iterator();
final List<Pack> result = new ArrayList<Pack>();
while (serverIds.hasNext()) {
int serverId = serverIds.next();
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
MapPack param = new MapPack();
long etime = TimeUtil.getCurrentTime();
long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
param.put("stime", stime);
param.put("etime", etime);
param.put("counter", counter);
param.put("objHash", serverObjMap.get(serverId));
tcp.process(RequestCmd.COUNTER_PAST_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
result.add(p);
}
});
} catch (Exception e) {
e.printStackTrace();
} finally {
TcpProxy.putTcpProxy(tcp);
}
}
ExUtil.exec(canvas, new Runnable() {
public void run() {
for (Pack pack : result) {
if ((pack instanceof MapPack) == false) {
continue;
}
MapPack m = (MapPack) pack;
int objHash = m.getInt("objHash");
ListValue time = m.getList("time");
ListValue value = m.getList("value");
if (time == null || time.size() < 1) {
continue;
}
CircularBufferDataProvider provider = (CircularBufferDataProvider) getDataProvider(objHash);
provider.clearTrace();
for (int i = 0; time != null && i < time.size(); i++) {
long x = time.getLong(i);
double y = value.getDouble(i);
provider.addSample(new Sample(x, y));
}
}
}
});
}
示例6: getRealtimePrevPerf
public void getRealtimePrevPerf(int objHash, String objType, String counter) {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
MapPack param = new MapPack();
param.put("objHash", objHash);
param.put("objType", objType);
param.put("counter", counter);
long etime = TimeUtil.getCurrentTime(serverId);
long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
param.put("stime", stime);
param.put("etime", etime);
MapPack out = (MapPack) tcp.getSingle(RequestCmd.COUNTER_PAST_TIME, param);
if (out == null){
return;
}
final ListValue time = out.getList("time");
final ListValue value = out.getList("value");
Map<Long, Value> map = new HashMap<Long, Value>();
for (int i = 0; time != null && i < time.size(); i++) {
map.put(CastUtil.clong(time.get(i)), value.get(i));
}
final TreeMap<Long, Value> treeMap = new TreeMap<Long, Value>( map );
ExUtil.exec(canvas, new Runnable() {
public void run() {
Iterator<Long> xs = treeMap.keySet().iterator();
clearAllTrace();
while(xs.hasNext()){
long tm = xs.next();
Value v = treeMap.get(tm);
if (v instanceof ListValue) {
ListValue list = (ListValue) v;
for (int j = 0, size = list.size(); j < size; j++) {
getDataProvider("data-" + j).addSample(new Sample(tm, list.getDouble(j)));
}
} else if (v != null && v.getValueType() != ValueEnum.NULL) {
getDataProvider("data").addSample(
new Sample(tm, CastUtil.cdouble(v)));
}
}
}
});
} catch (Throwable t) {
ConsoleProxy.errorSafe(t.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
}
}