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


Java DateUtil.getTime方法代码示例

本文整理汇总了Java中scouter.util.DateUtil.getTime方法的典型用法代码示例。如果您正苦于以下问题:Java DateUtil.getTime方法的具体用法?Java DateUtil.getTime怎么用?Java DateUtil.getTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scouter.util.DateUtil的用法示例。


在下文中一共展示了DateUtil.getTime方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void run() {
	if(startTime <= 0 && endTime <= 0){
		startTime = TimeUtil.getCurrentTime(serverId) - AfterMinuteUnit.FIVE_MIN.getTime();
		endTime = 0;
		String afterMinute = "5 min";
		AfterMinuteUnit m = AfterMinuteUnit.fromString(afterMinute);
		if (m != null) {
		 endTime = startTime + m.getTime();
		}
		if (DateUtil.isSameDay(new Date(startTime), new Date(endTime)) == false) {
		    endTime = DateUtil.getTime(DateUtil.format(startTime, "MM/dd/yyyy") + " 23:59", "MM/dd/yyyy HH:mm");
		}
	}
	if (window != null) {
		try {
			CounterPastTimeTotalView v = (CounterPastTimeTotalView) window.getActivePage().showView(CounterPastTimeTotalView.ID, 
					objType+counter + startTime + endTime+TimeUtil.getCurrentTime(serverId), IWorkbenchPage.VIEW_ACTIVATE);
			if (v != null) {
				v.setInput(startTime, endTime, objType, counter, serverId);
			}
		} catch (Exception e) {
			MessageDialog.openError(window.getShell(), "Error", "[OpenTotalLoadTimeCounterAction] Error opening view:" + e.getMessage());
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:26,代码来源:OpenPastTimeTotalAction.java

示例2: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void run() {
	if(startTime <= 0 && endTime <= 0){
		startTime = TimeUtil.getCurrentTime(serverId) - AfterMinuteUnit.FIVE_MIN.getTime();
		endTime = 0;
		String afterMinute = "5 min";
		AfterMinuteUnit m = AfterMinuteUnit.fromString(afterMinute);
		if (m != null) {
		 endTime = startTime + m.getTime();
		}
		if (DateUtil.isSameDay(new Date(startTime), new Date(endTime)) == false) {
		    endTime = DateUtil.getTime(DateUtil.format(startTime, "MM/dd/yyyy") + " 23:59", "MM/dd/yyyy HH:mm");
		}
	}
	if (window != null) {
		try {
			CounterPastTimeAllView v = (CounterPastTimeAllView) window.getActivePage().showView(CounterPastTimeAllView.ID, 
					objType+counter+startTime+endTime+TimeUtil.getCurrentTime(serverId), IWorkbenchPage.VIEW_ACTIVATE);
			if (v != null) {
				v.setInput(startTime, endTime, objType, counter, serverId);
			}
		} catch (Exception e) {
			MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:26,代码来源:OpenPastTimeAllAction.java

示例3: setInput

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(String sDate, String eDate, String objType, String counter, int serverId) throws Exception {
	this.sDate = sDate;
	this.eDate = eDate;
	this.objType = objType;
	this.counter = counter;
	this.mode = CounterUtil.getTotalMode(objType, counter);
	this.serverId = serverId;
	setViewTab(objType, counter, serverId, false);
	
	Server server = ServerManager.getInstance().getServer(serverId);
	String counterUnit = "";
	String counterDisplay = "";
	if(server != null){
		counterUnit = server.getCounterEngine().getCounterUnit(objType, counter);
		counterDisplay = server.getCounterEngine().getCounterDisplayName(objType, counter);
		desc = "(Period) [" + sDate.substring(0, 4) + "-" + sDate.substring(4, 6) + "-" + sDate.substring(6, 8) + 
				" ~ " + eDate.substring(0, 4) + "-" + eDate.substring(4, 6) + "-" + eDate.substring(6, 8) +
				"] Total " + counterDisplay;
	}
	serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |"+(!"".equals(counterUnit)?" ("+counterUnit+")":""));
	
	stime = DateUtil.getTime(sDate, "yyyyMMdd");
	etime = DateUtil.getTime(eDate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
	this.xyGraph.primaryXAxis.setRange(stime, etime);
	
	sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
	eDateText.setText(DateUtil.format(etime-1, "yyyy-MM-dd"));
	
	buffer = (int) ((etime - stime) / DateUtil.MILLIS_PER_FIVE_MINUTE);
	traceDataProvider.setBufferSize(buffer);
	
	MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);
	
	ExUtil.asyncRun(new Runnable() {
		public void run() {
			load();
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:40,代码来源:CounterPastLongDateTotalView.java

示例4: load

import scouter.util.DateUtil; //导入方法依赖的package包/类
private void load() {
	int fromHour = fromTime.getHours();
	int fromMin = fromTime.getMinutes();
	int toHour = toTime.getHours();
	int toMin = toTime.getMinutes();
	final long stime = DateUtil.getTime(yyyymmdd + (fromHour < 10 ? "0" + fromHour : fromHour) +  (fromMin < 10 ? "0" + fromMin : fromMin), "yyyyMMddHHmm");
	final long etime = DateUtil.getTime(yyyymmdd + (toHour < 10 ? "0" + toHour : toHour) +  (toMin < 10 ? "0" + toMin : toMin), "yyyyMMddHHmm");
	final String count = maxCountText.getText();
	final String level = levelCombo.getText();
	final String object = objText.getText();
	final String key = keyText.getText();
	ExUtil.asyncRun(new Runnable() {
		public void run() {
			TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
			final List<AlertData> dataList = new ArrayList<AlertData>();
			try {
				MapPack param = new MapPack();
				param.put("date", yyyymmdd);
				param.put("stime", stime);
				param.put("etime", etime);
				if (StringUtil.isNotEmpty(count)) {
					param.put("count", Long.valueOf(count));
				}
				if (StringUtil.isNotEmpty(level)  && "ALL".equalsIgnoreCase(level) == false) {
					param.put("level", level);
				}
				if (StringUtil.isNotEmpty(object)) {
					param.put("object", object);
				}
				if (StringUtil.isNotEmpty(key)) {
					param.put("key", key);
				}
				List<Pack> packList = tcp.process(RequestCmd.ALERT_LOAD_TIME, param);
				for (Pack pack : packList) {
					if (pack instanceof AlertPack) {
						AlertPack alertPack = (AlertPack) pack;
						AlertData data = new AlertData();
						data.time = alertPack.time;
						data.level = AlertLevel.getName(alertPack.level);
						data.object = TextProxy.object.getLoadText(yyyymmdd, alertPack.objHash, serverId);
						data.title = alertPack.title;
						data.message = alertPack.message;
						data.objType = alertPack.objType;
						data.tags = alertPack.tags;
						dataList.add(data);
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
				ConsoleProxy.errorSafe(e.getMessage());
			} finally {
				TcpProxy.putTcpProxy(tcp);
			}
			ExUtil.exec(viewer.getTable(), new Runnable() {
				public void run() {
					viewer.setInput(dataList);
				}
			});
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:62,代码来源:AlertDetailListView.java

示例5: load

import scouter.util.DateUtil; //导入方法依赖的package包/类
private void load() {
	final long stime = DateUtil.getTime(sDate, "yyyyMMdd");
	final long etime = DateUtil.getTime(eDate, "yyyyMMdd") + (DateUtil.MILLIS_PER_DAY - 1);
	collectObj();
	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();
			param.put("stime", stime);
			param.put("etime", etime);
			param.put("counter", counter);
			param.put("objHash", serverObjMap.get(serverId));
			tcp.process(RequestCmd.COUNTER_PAST_LONGDATE_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.FIVE_MIN);
	ExUtil.exec(canvas, new Runnable() {
		public void run() {
			xyGraph.primaryXAxis.setRange(stime, etime);
			CircularBufferDataProvider provider = (CircularBufferDataProvider) getDataProvider((int)((etime - stime) / DateUtil.MILLIS_PER_FIVE_MINUTE));
			provider.clearTrace();
			Set<Long> timeSet = valueMap.keySet();
			for (long time : timeSet) {
				provider.addSample(new Sample(time, CastUtil.cdouble(valueMap.get(time))));
			}
			if (CounterUtil.isPercentValue(objType, counter)) {
				xyGraph.primaryYAxis.setRange(0, 100);
			} else {
				double max = ChartUtil.getMax(provider.iterator());
				xyGraph.primaryYAxis.setRange(0, max);
			}
			applyBtn.setEnabled(true);
			canvas.redraw();
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:49,代码来源:CounterPastDateGroupTotalView.java

示例6: setInput

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(String sDate, String eDate, String objType, String counter, int serverId) throws Exception {
	this.sDate = sDate;
	this.eDate = eDate;
	this.objType = objType;
	this.counter = counter;
	this.serverId = serverId;
	setViewTab(objType, counter, serverId, false);
	
	stime = DateUtil.getTime(sDate, "yyyyMMdd");
	etime = DateUtil.getTime(eDate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
	this.xyGraph.primaryXAxis.setRange(stime, etime);
	
	Server server = ServerManager.getInstance().getServer(serverId);
	String counterUnit = "";
	String counterDisplay = "";
	if(server != null){
		counterUnit = server.getCounterEngine().getCounterUnit(objType, counter);
		counterDisplay = server.getCounterEngine().getCounterDisplayName(objType, counter);
		desc = "(Daily All) [" + sDate.substring(0, 4) + "-" + sDate.substring(4, 6) + "-" + sDate.substring(6, 8) + 
				" ~ " + eDate.substring(0, 4) + "-" + eDate.substring(4, 6) + "-" + eDate.substring(6, 8) +
				"]" + counterDisplay;
	}
	serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |"+(!"".equals(counterUnit)?" ("+counterUnit+")":""));
	sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
	eDateText.setText(DateUtil.format(etime-1, "yyyy-MM-dd"));
	
	buffer = (int) ((etime - stime) / DateUtil.MILLIS_PER_FIVE_MINUTE);
	
	Iterator<Trace> itr = traces.values().iterator();
	while (itr.hasNext()) {
		Trace tr = itr.next();
		this.xyGraph.removeTrace(tr);
	}
	traces.clear();
	
	MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);
	
	ExUtil.asyncRun(new Runnable() {
		public void run() {
			load(CounterPastLongDateAllView.this.sDate, CounterPastLongDateAllView.this.eDate, CounterPastLongDateAllView.this.counter);
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:44,代码来源:CounterPastLongDateAllView.java

示例7: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_SERVICE_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Integer, SummaryData> summaryDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            ListValue idLv = m.getList("id");
            ListValue countLv = m.getList("count");
            ListValue errorLv = m.getList("error");
            ListValue elapsedLv = m.getList("elapsed");
            ListValue cpuLv = m.getList("cpu");
            ListValue memLv = m.getList("mem");
            for (int i = 0; i < idLv.size(); i++) {
                SummaryData data = new SummaryData();
                data.hash = idLv.getInt(i);
                data.count = countLv.getInt(i);
                data.errorCount = errorLv.getInt(i);
                data.elapsedSum = elapsedLv.getLong(i);
                data.cpu = cpuLv.getLong(i);
                data.mem = memLv.getLong(i);
                if (summaryDataMap.containsKey(data.hash)) {
                    summaryDataMap.get(data.hash).addData(data);
                } else {
                    summaryDataMap.put(data.hash, data);
                }
            }
            TextProxy.service.load(date, idLv, serverId);
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(summaryDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:55,代码来源:ServiceSummaryComposite.java

示例8: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_UA_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Integer, SummaryData> summaryDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            ListValue idLv = m.getList("id");
            ListValue countLv = m.getList("count");
            for (int i = 0; i < idLv.size(); i++) {
                SummaryData data = new SummaryData();
                data.hash = idLv.getInt(i);
                data.count = countLv.getInt(i);
                if (summaryDataMap.containsKey(data.hash)) {
                    summaryDataMap.get(data.hash).addData(data);
                } else {
                    summaryDataMap.put(data.hash, data);
                }
            }
            TextProxy.userAgent.load(date, idLv, serverId);
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(summaryDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:47,代码来源:UserAgentSummaryComposite.java

示例9: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_ALERT_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<String, AlertData> alertDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            
            ListValue titleLv = m.getList("title");
	ListValue levelLv = m.getList("level");
	ListValue countLv = m.getList("count");
	for (int i = 0; i < titleLv.size(); i++) {
		AlertData data = new AlertData();
		data.title = titleLv.getString(i);
		data.level = (byte) levelLv.getInt(i);
		data.count = countLv.getInt(i);
		if (alertDataMap.containsKey(data.title)) {
			alertDataMap.get(data.title).addData(data);
		} else {
			alertDataMap.put(data.title, data);
		}
	}                    
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(alertDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:49,代码来源:AlertSummaryComposite.java

示例10: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_SQL_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Integer, SummaryData> summaryDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            ListValue idLv = m.getList("id");
            ListValue countLv = m.getList("count");
            ListValue errorLv = m.getList("error");
            ListValue elapsedLv = m.getList("elapsed");
            for (int i = 0; i < idLv.size(); i++) {
                SummaryData data = new SummaryData();
                data.hash = idLv.getInt(i);
                data.count = countLv.getInt(i);
                data.errorCount = errorLv.getInt(i);
                data.elapsedSum = elapsedLv.getLong(i);
                if (summaryDataMap.containsKey(data.hash)) {
                    summaryDataMap.get(data.hash).addData(data);
                } else {
                    summaryDataMap.put(data.hash, data);
                }
            }
            TextProxy.sql.load(date, idLv, serverId);
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(summaryDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:51,代码来源:SqlSummaryComposite.java

示例11: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_APICALL_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Integer, SummaryData> summaryDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            ListValue idLv = m.getList("id");
            ListValue countLv = m.getList("count");
            ListValue errorLv = m.getList("error");
            ListValue elapsedLv = m.getList("elapsed");
            for (int i = 0; i < idLv.size(); i++) {
                SummaryData data = new SummaryData();
                data.hash = idLv.getInt(i);
                data.count = countLv.getInt(i);
                data.errorCount = errorLv.getInt(i);
                data.elapsedSum = elapsedLv.getLong(i);
                if (summaryDataMap.containsKey(data.hash)) {
                    summaryDataMap.get(data.hash).addData(data);
                } else {
                    summaryDataMap.put(data.hash, data);
                }
            }
            TextProxy.apicall.load(date, idLv, serverId);
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(summaryDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:51,代码来源:ApicallSummaryComposite.java

示例12: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_IP_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Integer, SummaryData> summaryDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            ListValue idLv = m.getList("id");
            ListValue countLv = m.getList("count");
            for (int i = 0; i < idLv.size(); i++) {
                SummaryData data = new SummaryData();
                data.hash = idLv.getInt(i);
                data.count = countLv.getInt(i);
                if (summaryDataMap.containsKey(data.hash)) {
                    summaryDataMap.get(data.hash).addData(data);
                } else {
                    summaryDataMap.put(data.hash, data);
                }
            }
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(summaryDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:46,代码来源:IpSummaryComposite.java

示例13: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
    TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
    List<Pack> packList = new ArrayList<>();
    try {
        while (stime <= etime) {
            String date = DateUtil.yyyymmdd(stime);
            long lastTimestampOfDay = DateUtil.getTime(date, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY - 1;
            param.put("date", date);
            param.put("stime", stime);
            param.put("etime", lastTimestampOfDay <= etime ? lastTimestampOfDay : etime);
            packList.add(tcp.getSingle(RequestCmd.LOAD_SERVICE_ERROR_SUMMARY, param));
            stime += DateUtil.MILLIS_PER_DAY;
        }
    } catch (Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
    } finally {
        TcpProxy.putTcpProxy(tcp);
    }

    if (packList.size() > 0) {
        Map<Long, ErrorData> errorDataMap = new HashMap<>();
        for (Pack p : packList) {
            MapPack m = (MapPack) p;
            
            ListValue errorLv = m.getList("error");
            ListValue serviceLv = m.getList("service");
            ListValue messageLv = m.getList("message");
            ListValue countLv = m.getList("count");
            ListValue txidLv = m.getList("txid");
            ListValue sqlLv = m.getList("sql");
            ListValue apiLv = m.getList("apicall");
            ListValue stackLv = m.getList("fullstack");
            for (int i = 0; i < errorLv.size(); i++) {
            		ErrorData data = new ErrorData();
            		data.error = errorLv.getInt(i);
            		data.service = serviceLv.getInt(i);
            		data.message = messageLv.getInt(i);
            		data.count = countLv.getInt(i);
            		data.txid = txidLv.getLong(i);
            		data.sql = sqlLv.getInt(i);
            		data.apicall = apiLv.getInt(i);
            		data.fullstack = stackLv.getInt(i);
            		long key = BitUtil.composite(data.error, data.service);
            		if (errorDataMap.containsKey(key)) {
            			errorDataMap.get(key).addData(data);
            		} else {
            			errorDataMap.put(key, data);
            		}
            }
            
            TextProxy.error.load(date, errorLv, serverId);
	TextProxy.service.load(date, serviceLv, serverId);
	TextProxy.error.load(date, messageLv, serverId);
	TextProxy.sql.load(date, sqlLv, serverId);
	TextProxy.apicall.load(date, apiLv, serverId);
	TextProxy.error.load(date, stackLv, serverId);
        }
        ExUtil.exec(viewer.getTable(), new Runnable() {
            public void run() {
                viewer.setInput(errorDataMap.values());
            }
        });
    }
    return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:67,代码来源:ErrorSummaryComposite.java


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