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


Java ListValue.getLong方法代码示例

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


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

示例1: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public void run() {
	double max = 0;
	for (MapPack mpack : values) {
		int objHash = mpack.getInt("objHash");
		
		//String insName = mpack.getText("objName");
		ListValue time = mpack.getList("time");
		ListValue value = mpack.getList("value");
		Trace trace = intern(objHash);
		CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();
		
		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));
		}
		max = Math.max(ChartUtil.getMax(provider.iterator()), max);
	}
	if (CounterUtil.isPercentValue(objType, counter)) {
		xyGraph.primaryYAxis.setRange(0, 100);
	} else {
			xyGraph.primaryYAxis.setRange(0, max);
	}
	redraw();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:27,代码来源:CounterPastTimeAllView.java

示例2: getObjectList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public ArrayList<AgentObject> getObjectList(String date, int serverId) {
	ArrayList<AgentObject> agentList = new ArrayList<AgentObject>();
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		if (objHashLv == null || objHashLv.size() < 0) {
			return agentList;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			int objHash = (int) objHashLv.getLong(i);
			String objType = objTypeLv.getString(i);
			String objName = objNameLv.getString(i);
			AgentObject agentObject = new AgentObject(objType, objHash, objName,  serverId);
			agentList.add(agentObject);
		}
	} catch (Exception e) {
		ConsoleProxy.errorSafe(e.toString());
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return agentList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:28,代码来源:AgentDailyListProxy.java

示例3: getAgentObject

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public AgentObject getAgentObject(String date, int serverId, int objHash) {
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		if (objHashLv == null || objHashLv.size() < 0) {
			return null;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			int hash = (int) objHashLv.getLong(i);
			if (objHash == hash) {
				String objType = objTypeLv.getString(i);
				String objName = objNameLv.getString(i);
				return new AgentObject(objType, objHash, objName,  serverId);
			}
		}
	} catch (Exception e) {
		ConsoleProxy.errorSafe(e.toString());
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:28,代码来源:AgentDailyListProxy.java

示例4: load

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public void load(String date, ListValue hashList, int serverId) {
	ArrayList<Integer> arrList = new ArrayList<Integer>();
	for (int i = 0; i < hashList.size(); i++) {
		int hash = (int) hashList.getLong(i);
		if (hash != 0) {
			arrList.add(hash);
		}
	}
	load(date, arrList, serverId);

}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:12,代码来源:TextModel.java

示例5: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public void run() {
				double max = 0;
				for (MapPack mpack : values) {
					int objHash = mpack.getInt("objHash");
					
					//String insName = mpack.getText("objName");
					ListValue time = mpack.getList("time");
					ListValue value = mpack.getList("value");

					Trace trace = intern(objHash);
					CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();
					
//					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));
					}
					max = Math.max(ChartUtil.getMax(provider.iterator()), max);
				}
				if (CounterUtil.isPercentValue(objType, counter)) {
					xyGraph.primaryYAxis.setRange(0, 100);
				} else {
						xyGraph.primaryYAxis.setRange(0, max);
				}
				redraw();
				applyBtn.setEnabled(true);
			}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:29,代码来源:CounterPastLongDateAllView.java

示例6: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	Pack p = null;
	try {
		p = tcp.getSingle(RequestCmd.LOAD_SQL_SUMMARY, param);
	} catch (Exception e) {
		e.printStackTrace();
		return Status.CANCEL_STATUS;
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	if (p != null) {
		final List<SummaryData> list = new ArrayList<SummaryData>();
		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);
			list.add(data);
		}
		TextProxy.sql.load(date, idLv, serverId);
		ExUtil.exec(viewer.getTable(), new Runnable() {
			public void run() {
				viewer.setInput(list);
			}
		});
	}
	 
	return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:38,代码来源:SqlSummaryComposite.java

示例7: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	Pack p = null;
	try {
		p = tcp.getSingle(RequestCmd.LOAD_APICALL_SUMMARY, param);
	} catch (Exception e) {
		e.printStackTrace();
		return Status.CANCEL_STATUS;
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	if (p != null) {
		final List<SummaryData> list = new ArrayList<SummaryData>();
		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);
			list.add(data);
		}
		TextProxy.apicall.load(date, idLv, serverId);
		ExUtil.exec(viewer.getTable(), new Runnable() {
			public void run() {
				viewer.setInput(list);
			}
		});
	}
	 
	return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:38,代码来源:ApicallSummaryComposite.java

示例8: getRealElapsedAvgValue

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private static double getRealElapsedAvgValue(List<Pack> result) {
	double totalValue = 0.0d;
	double tpsSum = 0.0d;
	for (Pack p : result) {
		MapPack m = (MapPack) p;
		ListValue objHashLv = m.getList("objHash");
		ListValue valueLv = m.getList("value");
		for (int i = 0; i < objHashLv.size(); i++) {
			int objHash = (int) objHashLv.getLong(i);
			double elapsed = CastUtil.cdouble(valueLv.get(i));
			AgentObject agent = AgentModelThread.getInstance().getAgentObject(objHash);
			if (agent == null) {
				continue;
			}
			final List<Double> tpsValue = new ArrayList<Double>(1);
			TcpProxy tcp = TcpProxy.getTcpProxy(agent.getServerId());
			try {
				MapPack param = new MapPack();
				param.put("objHash", objHash);
				param.put("counter", CounterConstants.WAS_TPS);
				param.put("timetype", TimeTypeEnum.REALTIME);
				tcp.process(RequestCmd.COUNTER_REAL_TIME, param, new INetReader() {
					public void process(DataInputX in) throws IOException {
						Value v = in.readValue();
						if (v != null && v.getValueType() != ValueEnum.NULL) {
							tpsValue.add(CastUtil.cdouble(v));
						}
					}
				});

			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				TcpProxy.putTcpProxy(tcp);
			}
			double tps = tpsValue.get(0);
			totalValue += (elapsed * tps);
			tpsSum += tps;
		}
	}
	if (totalValue == 0 || tpsSum == 0) {
		return 0;
	}
	return totalValue / tpsSum;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:46,代码来源:ScouterUtil.java

示例9: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	Pack p = null;
	try {
		p = tcp.getSingle(RequestCmd.LOAD_SERVICE_SUMMARY, param);
	} catch (Exception e) {
		e.printStackTrace();
		return Status.CANCEL_STATUS;
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	if (p != null) {
		final List<SummaryData> list = new ArrayList<SummaryData>();
		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);
			list.add(data);
		}
		TextProxy.service.load(date, idLv, serverId);
		ExUtil.exec(viewer.getTable(), new Runnable() {
			public void run() {
				viewer.setInput(list);
			}
		});
	}
	 
	return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:42,代码来源:ServiceSummaryComposite.java

示例10: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	Pack p = null;
	try {
		p = tcp.getSingle(RequestCmd.LOAD_SERVICE_ERROR_SUMMARY, param);
	} catch (Exception e) {
		e.printStackTrace();
		return Status.CANCEL_STATUS;
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	if (p != null) {
		final List<ErrorData> list = new ArrayList<ErrorData>();
		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);
			list.add(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(list);
			}
		});
	}
	 
	return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:53,代码来源:ErrorSummaryComposite.java

示例11: loadObjectList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private ArrayList<ObjectPack> loadObjectList(String date) {
	ArrayList<ObjectPack> objList = new ArrayList<ObjectPack>();
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		
		if (objHashLv == null || objHashLv.size() < 0) {
			return objList;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			ObjectPack pack = new ObjectPack();
			pack.objType = objTypeLv.getString(i);
			if (pack.objType.equals(objType) == false) {
				continue;
			}
			pack.objHash = (int) objHashLv.getLong(i);
			pack.objName = objNameLv.getString(i);
			objList.add(pack);
		}
		Collections.sort(objList, new Comparator<Pack>() {
			public int compare(Pack o1, Pack o2) {
				ObjectPack m1 = (ObjectPack) o1;
				ObjectPack m2 = (ObjectPack) o2;
				int c = m1.objType.compareTo(m2.objType);
				if (c != 0)
					return c;
				if (m1.objName != null)
					return m1.objName.compareTo(m2.objName);
				else
					return m1.objHash - m2.objHash;
			}
		});
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return objList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:43,代码来源:XLogSearchDialog.java

示例12: ofPackList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public static List<SActiveService> ofPackList(List<Pack> activeServicePackList) {
	List<SActiveService> resultList = new ArrayList<>();

	for (Pack pack : activeServicePackList) {
		MapPack mapPack = (MapPack) pack;
		int objHash = mapPack.getInt("objHash");
		String objName = AgentModelThread.getInstance().getAgentObject(objHash).getObjName();

		ListValue idLv = mapPack.getList("id");
		ListValue nameLv = mapPack.getList("name");
		ListValue statLv = mapPack.getList("stat");
		ListValue cpuLv = mapPack.getList("cpu");
		ListValue txidLv = mapPack.getList("txid");
		ListValue elapsedLv = mapPack.getList("elapsed");
		ListValue serviceLv = mapPack.getList("service");
		ListValue ipLv = mapPack.getList("ip");
		ListValue sqlLv = mapPack.getList("sql");
		ListValue subcallLv = mapPack.getList("subcall");

		if (idLv != null) {
			int size = idLv.size();

			for (int i = 0; i < size; i++) {
				SActiveService activeService = new SActiveService();
				activeService.objHash = objHash;
				activeService.objName = objName;
				activeService.threadId = idLv.getLong(i);
				activeService.threadName = nameLv.getString(i);
				activeService.threadStatus = statLv.getString(i);
				activeService.threadCpuTime = cpuLv.getLong(i);
				activeService.txidName = txidLv.getString(i);
				activeService.elapsed = elapsedLv.getLong(i);
				activeService.serviceName = serviceLv.getString(i);
				String sql = sqlLv.getString(i);
				String api = subcallLv.getString(i);
				if (StringUtil.isNotEmpty(sql)) {
					activeService.note = sql;
					activeService.mode = ActiveServiceMode.SQL.name();
				} else if (StringUtil.isNotEmpty(api)) {
					activeService.note = api;
					activeService.mode = ActiveServiceMode.SUBCALL.name();
				}
				if (ipLv != null) {
					activeService.ipaddr = ipLv.getString(i);
				}

				resultList.add(activeService);
			}
		}
		resultList.sort((s1, s2) -> s1.elapsed > s2.elapsed ? -1 : 1);
	}

	return resultList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:55,代码来源:SActiveService.java


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