本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}