当前位置: 首页>>代码示例>>Java>>正文


Java DateUtil.MILLIS_PER_MINUTE属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:ScouterUtil.java

示例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))));
			}
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:39,代码来源:CounterRealTimeGroupTotalView.java

示例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));
				}
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:36,代码来源:CounterRealTimeTotalView.java

示例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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:DigestTableView.java

示例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));
				}
			}
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:52,代码来源:CounterRealTimeGroupAllView.java

示例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);
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:56,代码来源:CounterRealTimeView.java


注:本文中的scouter.util.DateUtil.MILLIS_PER_MINUTE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。