本文整理汇总了Java中scouter.lang.value.ListValue.size方法的典型用法代码示例。如果您正苦于以下问题:Java ListValue.size方法的具体用法?Java ListValue.size怎么用?Java ListValue.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scouter.lang.value.ListValue
的用法示例。
在下文中一共展示了ListValue.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteDbFiles
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@ServiceHandler(RequestCmd.SERVER_DB_DELETE)
public void deleteDbFiles(DataInputX din, DataOutputX dout, boolean login) throws IOException {
String rootPath = DBCtr.getRootPath();
MapPack param = (MapPack) din.readPack();
ListValue fileLv = param.getList("file");
MapPack m = new MapPack();
if (fileLv != null) {
for (int i = 0; i < fileLv.size(); i++) {
String filename = fileLv.getString(i);
File file = new File(rootPath + filename);
deleteFiles(file);
}
m.put("size", fileLv.size());
}
dout.writeByte(TcpFlag.HasNEXT);
dout.writePack(m);
dout.flush();
}
示例2: removeDeadGroup
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeDeadGroup(MapPack m) {
ListValue nameLv = m.getList("name");
ArrayList<String> grpSet = new ArrayList<String>();
Iterator<String> enu = traces.keySet().iterator();
while(enu.hasNext()){
grpSet.add(enu.next());
}
for (int i = 0; i < nameLv.size(); i++) {
String name = nameLv.getString(i);
grpSet.remove(name);
}
for (String dead : grpSet) {
final Trace t = traces.get(dead);
if (t == null) continue;
ExUtil.exec(canvas, new Runnable() {
public void run() {
xyGraph.removeTrace(t);
}
});
traces.remove(dead);
}
}
示例3: removeDeadGroup
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeDeadGroup(MapPack m) {
ListValue nameLv = m.getList("name");
ArrayList<String> grpSet = new ArrayList<String>();
Enumeration<String> enu =stackValueMap.keys();
while(enu.hasMoreElements()){
grpSet.add(enu.nextElement());
}
for (int i = 0; i < nameLv.size(); i++) {
String name = nameLv.getString(i);
grpSet.remove(name);
}
for (String dead : grpSet) {
stackValueMap.remove(dead);
final Trace t = traces.get(dead);
if (t == null) continue;
ExUtil.exec(canvas, new Runnable() {
public void run() {
xyGraph.removeTrace(t);
}
});
traces.remove(dead);
}
}
示例4: toSummary
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@Override
public Summary<SqlSummaryItem> toSummary(List<DateAndMapPack> dnmPackList, int serverId) {
Summary<SqlSummaryItem> summary = new Summary<>();
for (DateAndMapPack dnmPack : dnmPackList) {
long date = DateTimeHelper.getDefault().yyyymmdd(dnmPack.getYyyymmdd());
ListValue idList = dnmPack.getMapPack().getList("id");
ListValue countList = dnmPack.getMapPack().getList("count");
ListValue errorCntList = dnmPack.getMapPack().getList("error");
ListValue elapsedSumList = dnmPack.getMapPack().getList("elapsed");
for(int i = 0; i < idList.size(); i++) {
SqlSummaryItem item = SqlSummaryItem.builder()
.summaryKey(idList.getInt(i))
.summaryKeyName(TextProxy.sql.getTextIfNullDefault(date, idList.getInt(i), serverId))
.count(countList.getInt(i))
.errorCount(errorCntList.getInt(i))
.elapsedSum(elapsedSumList.getLong(i)).build();
summary.merge(item);
}
}
return summary;
}
示例5: getObjectsByGroup
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public Set<Integer> getObjectsByGroup(String grpName) {
Set objSet = groupObjTable.get(grpName);
if (objSet != null) {
return objSet;
}
objSet = new HashSet<Integer>();
Iterator<String> keys = objGroupMap.keys();
while (keys.hasNext()) {
String objHash = keys.next();
Value v = objGroupMap.get(objHash);
if (v != null && v instanceof ListValue) {
ListValue groupLv = (ListValue) v;
for (int i = 0; i < groupLv.size(); i++) {
if (grpName.equals(groupLv.getString(i))) {
objSet.add(Integer.valueOf(objHash));
break;
}
}
}
}
groupObjTable.put(grpName, objSet);
return objSet;
}
示例6: 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();
}
示例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_IP_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");
for (int i = 0; i < idLv.size(); i++) {
SummaryData data = new SummaryData();
data.hash = idLv.getInt(i);
data.count = countLv.getInt(i);
list.add(data);
}
ExUtil.exec(viewer.getTable(), new Runnable() {
public void run() {
viewer.setInput(list);
}
});
}
return Status.OK_STATUS;
}
示例8: removeObject
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeObject(int objHash, String groupName) {
Value v = objGroupMap.get(String.valueOf(objHash));
if (v != null && v instanceof ListValue) {
ListValue groups = (ListValue) v;
ListValue newLv = new ListValue();
for (int i = 0; i < groups.size(); i++) {
String name = groups.getString(i);
if (groupName.equals(name)) {
continue;
}
newLv.add(name);
}
objGroupMap.put(String.valueOf(objHash), newLv);
}
}
示例9: toSummary
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@Override
public Summary<ErrorSummaryItem> toSummary(List<DateAndMapPack> dnmPackList, int serverId) {
Summary<ErrorSummaryItem> summary = new Summary<>();
for (DateAndMapPack dnmPack : dnmPackList) {
long date = DateTimeHelper.getDefault().yyyymmdd(dnmPack.getYyyymmdd());
ListValue idList = dnmPack.getMapPack().getList("id");
ListValue countList = dnmPack.getMapPack().getList("count");
ListValue errorList = dnmPack.getMapPack().getList("error");
ListValue serviceList = dnmPack.getMapPack().getList("service");
ListValue errorMessageList = dnmPack.getMapPack().getList("message");
ListValue txidList = dnmPack.getMapPack().getList("txid");
ListValue sqlList = dnmPack.getMapPack().getList("sql");
ListValue apiCallList = dnmPack.getMapPack().getList("apicall");
ListValue fullStackList = dnmPack.getMapPack().getList("fullstack");
for(int i = 0; i < idList.size(); i++) {
String error = TextProxy.error.getTextIfNullDefault(date, errorList.getInt(i), serverId);
String service = TextProxy.service.getTextIfNullDefault(date, serviceList.getInt(i), serverId);
ErrorSummaryItem item = ErrorSummaryItem.builder()
.summaryKey(idList.getInt(i))
.summaryKeyName(error + " [:of:] " + service)
.count(countList.getInt(i))
.error(error)
.service(service)
.errorMessage(TextProxy.error.getTextIfNullDefault(date, errorMessageList.getInt(i), serverId))
.txid(txidList.getLong(i))
.sql(TextProxy.sql.getTextIfNullDefault(date, sqlList.getInt(i), serverId))
.apiCall(TextProxy.apicall.getTextIfNullDefault(date, apiCallList.getInt(i), serverId))
.fullStack(TextProxy.error.getTextIfNullDefault(date, fullStackList.getInt(i), serverId)).build();
summary.merge(item);
}
}
return summary;
}
示例10: 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);
}
示例11: toSummary
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@Override
public Summary<ServiceSummaryItem> toSummary(List<DateAndMapPack> dnmPackList, int serverId) {
Summary<ServiceSummaryItem> summary = new Summary<>();
for (DateAndMapPack dnmPack : dnmPackList) {
long date = DateTimeHelper.getDefault().yyyymmdd(dnmPack.getYyyymmdd());
ListValue idList = dnmPack.getMapPack().getList("id");
ListValue countList = dnmPack.getMapPack().getList("count");
ListValue errorCntList = dnmPack.getMapPack().getList("error");
ListValue elapsedSumList = dnmPack.getMapPack().getList("elapsed");
ListValue cpuSumList = dnmPack.getMapPack().getList("cpu");
ListValue memSumList = dnmPack.getMapPack().getList("mem");
for(int i = 0; i < idList.size(); i++) {
ServiceSummaryItem item = ServiceSummaryItem.builder()
.summaryKey(idList.getInt(i))
.summaryKeyName(TextProxy.service.getTextIfNullDefault(date, idList.getInt(i), serverId))
.count(countList.getInt(i))
.errorCount(errorCntList.getInt(i))
.elapsedSum(elapsedSumList.getLong(i))
.cpuSum(cpuSumList.getLong(i))
.memorySum(memSumList.getLong(i)).build();
summary.merge(item);
}
}
return summary;
}
示例12: triggerThreadList
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public static Pack triggerThreadList() {
PrintWriter out = null;
MapPack pack = new MapPack();
try {
File file = DumpUtil.getDumpFile("scouter.threads");
out = new PrintWriter(new FileWriter(file));
MapPack mpack = ThreadUtil.getThreadList();
ListValue ids = mpack.getList("id");
ListValue name = mpack.getList("name");
ListValue stat = mpack.getList("stat");
ListValue cpu = mpack.getList("cpu");
for (int i = 0; i < ids.size(); i++) {
long tid = CastUtil.clong(ids.get(i));
out.print(i + ":");
out.print(tid + ":");
out.print(name.get(i) + ":");
out.print(stat.get(i) + ":");
out.print("cpu " + cpu.get(i));
TraceContext ctx = TraceContextManager.getContext(tid);
if (ctx != null) {
out.print(":service " + Hexa32.toString32(ctx.txid) + ":");
out.print(ctx.serviceName + ":");
long etime = System.currentTimeMillis() - ctx.startTime;
out.print(etime + " ms");
}
out.println("");
printStack(out, tid);
out.println("");
pack.put("name", file.getName());
}
} catch (Throwable e) {
e.printStackTrace();
} finally {
FileUtil.close(out);
}
return pack;
}
示例13: counter
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
/**
* PerfCounterPack 발생 시 처리
* @param pack
*/
@ServerPlugin(PluginConstants.PLUGIN_SERVER_COUNTER)
public void counter(PerfCounterPack pack) {
String objName = pack.objName;
int objHash = HashUtil.hash(objName);
String objType = null;
String objFamily = null;
if (AgentManager.getAgent(objHash) != null) {
objType = AgentManager.getAgent(objHash).objType;
}
if (objType != null) {
try {
objFamily = CounterManager.getInstance().getCounterEngine().getObjectType(objType).getFamily().getName();
} catch (Exception e) {
objFamily = objType;
}
}
// objFamily가 host인 경우
if (CounterConstants.FAMILY_HOST.equals(objFamily)) {
if (hostAgentStatMap.get(objHash) == null) {
hostAgentStatMap.put(objHash, new HostAgentStat(objHash));
}
if (pack.timetype == TimeTypeEnum.REALTIME) {
hostAgentStatMap.get(objHash).addMax(pack.data.getFloat(CounterConstants.HOST_CPU),
pack.data.getInt(CounterConstants.HOST_MEM_TOTAL),
pack.data.getFloat(CounterConstants.HOST_MEM),
pack.data.getInt(CounterConstants.HOST_MEM_USED),
pack.data.getInt(CounterConstants.HOST_NET_TX_BYTES),
pack.data.getInt(CounterConstants.HOST_NET_RX_BYTES),
pack.data.getInt(CounterConstants.HOST_DISK_READ_BYTES),
pack.data.getInt(CounterConstants.HOST_DISK_WRITE_BYTES));
} else if (pack.timetype == TimeTypeEnum.FIVE_MIN) {
// NET_TX, NET_RX, DISK_READ, DISK_WRITE 정보는 FIVE_MIN에 포함되지 않음.
hostAgentStatMap.get(objHash).addAvg(pack.data.getFloat(CounterConstants.HOST_CPU),
pack.data.getFloat(CounterConstants.HOST_MEM),
pack.data.getInt(CounterConstants.HOST_MEM_USED));
}
}
// objFamily가 javaee인 경우
if (CounterConstants.FAMILY_JAVAEE.equals(objFamily)) {
if (javaAgentStatMap.get(objHash) == null) {
javaAgentStatMap.put(objHash, new JavaAgentStat(objHash));
}
if (pack.timetype == TimeTypeEnum.REALTIME) {
// JAVA_HEAP_TOT_USAGE 정보가 없는 PerfCounterPack은 host agent가 동작중에 PROC_CPU 정보를 보내주는 경우와, FIVE_MIN 밖에 없음.
// PROC_CPU 정보는 수집 대상이 아님.
ListValue lv = pack.data.getList(CounterConstants.JAVA_HEAP_TOT_USAGE);
if (lv != null && lv.size() > 0) {
javaAgentStatMap.get(objHash).addMax(pack.data.getInt(CounterConstants.WAS_ACTIVE_SERVICE),
lv.getFloat(0),
pack.data.getFloat(CounterConstants.JAVA_HEAP_USED),
pack.data.getInt(CounterConstants.WAS_RECENT_USER),
pack.data.getInt(CounterConstants.WAS_SERVICE_COUNT),
pack.data.getFloat(CounterConstants.WAS_APICALL_TPS),
pack.data.getFloat(CounterConstants.WAS_SQL_TPS),
pack.data.getFloat(CounterConstants.WAS_TPS));
}
} else if (pack.timetype == TimeTypeEnum.FIVE_MIN) {
if (pack.data.toMap().get(CounterConstants.PROC_CPU) == null) {
javaAgentStatMap.get(objHash).addAvg(pack.data.getInt(CounterConstants.WAS_ACTIVE_SERVICE),
pack.data.getFloat(CounterConstants.JAVA_HEAP_USED),
pack.data.getInt(CounterConstants.WAS_RECENT_USER),
pack.data.getInt(CounterConstants.WAS_SERVICE_COUNT),
pack.data.getFloat(CounterConstants.WAS_APICALL_TPS),
pack.data.getFloat(CounterConstants.WAS_SQL_TPS),
pack.data.getFloat(CounterConstants.WAS_TPS));
}
}
}
}
示例14: run
import scouter.lang.value.ListValue; //导入方法依赖的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;
}
示例15: isEmpty
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public static boolean isEmpty(ListValue arr) {
return arr == null || arr.size() == 0;
}