本文整理汇总了Java中scouter.lang.value.ListValue.add方法的典型用法代码示例。如果您正苦于以下问题:Java ListValue.add方法的具体用法?Java ListValue.add怎么用?Java ListValue.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scouter.lang.value.ListValue
的用法示例。
在下文中一共展示了ListValue.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHeapUsage
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@Counter
public void getHeapUsage(CounterBasket pw) {
long total = Runtime.getRuntime().totalMemory();
long free = Runtime.getRuntime().freeMemory();
float used = (float) ((total - free) / 1024. / 1024.);
heapmin.add(total - free);
float usedmin = (float) (heapmin.getAvg(300) / 1024. / 1024.);
ListValue heapValues = new ListValue();
heapValues.add((float) (total / 1024. / 1024.));
heapValues.add(used);
PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME);
p.put(CounterConstants.JAVA_HEAP_TOT_USAGE, heapValues);
p.put(CounterConstants.JAVA_HEAP_USED, new FloatValue(used));
p = pw.getPack(TimeTypeEnum.FIVE_MIN);
p.put(CounterConstants.JAVA_HEAP_USED, new FloatValue(usedmin));
}
示例2: collectDirectory
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private long collectDirectory(File dir, ListValue nameLv, ListValue sizeLv, ListValue lastModifiedLv,
String rootPath) {
long length = 0;
for (File file : dir.listFiles()) {
if (file.isFile()) {
length += file.length();
} else {
long size = collectDirectory(file, nameLv, sizeLv, lastModifiedLv, rootPath);
nameLv.add(file.getAbsolutePath().substring(rootPath.length()));
lastModifiedLv.add(file.lastModified());
sizeLv.add(size);
length += size;
}
}
return length;
}
示例3: getDumpFileList
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@RequestHandler(RequestCmd.OBJECT_DUMP_FILE_LIST)
public Pack getDumpFileList(Pack param) {
MapPack result = new MapPack();
ListValue nameLv = result.newList("name");
ListValue sizeLv = result.newList("size");
ListValue lastModifedLv = result.newList("last_modified");
File dumpDir = Configure.getInstance().dump_dir;
if (dumpDir.canRead()) {
for (File file : dumpDir.listFiles()) {
if (file.isFile()) {
nameLv.add(file.getName());
sizeLv.add(file.length());
lastModifedLv.add(file.lastModified());
}
}
}
return result;
}
示例4: run
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
monitor.beginTask("Delete Server Files.....", IProgressMonitor.UNKNOWN);
MapPack param = new MapPack();
ListValue fileLv = param.newList("file");
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof DirObject) {
DirObject obj = (DirObject) elements[i];
fileLv.add(obj.name);
}
}
MapPack m = (MapPack) tcp.getSingle(RequestCmd.SERVER_DB_DELETE, param);
monitor.done();
int size = m.getInt("size");
ConsoleProxy.infoSafe(size + " directories is deleted.");
load();
} catch (Exception e) {
e.printStackTrace();
} finally {
TcpProxy.putTcpProxy(tcp);
}
return Status.OK_STATUS;
}
示例5: listHeapDump
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@RequestHandler(RequestCmd.OBJECT_LIST_HEAP_DUMP)
public Pack listHeapDump(Pack param) {
MapPack p = new MapPack();
ListValue nameLv = p.newList("name");
ListValue sizeLv = p.newList("size");
File hprofDir = new File(folderName);
if (hprofDir.exists() == false) {
return null;
}
File[] fileList = hprofDir.listFiles(new ContentFilter());
if (fileList != null && fileList.length > 0) {
for (int i = 0; i < fileList.length; i++) {
File f = fileList[i];
if (/* f.isFile() && */f.getName().endsWith(fileExt)) {
nameLv.add(f.getName());
sizeLv.add(f.length());
}
}
return p;
}
return p;
}
示例6: getKeyValueInfo
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public MapValue getKeyValueInfo() {
StringKeyLinkedMap<Object> defMap = ConfigValueUtil.getConfigDefault(new Configure(true));
StringKeyLinkedMap<Object> curMap = ConfigValueUtil.getConfigDefault(this);
MapValue m = new MapValue();
ListValue nameList = m.newList("key");
ListValue valueList = m.newList("value");
ListValue defList = m.newList("default");
StringEnumer enu = defMap.keys();
while (enu.hasMoreElements()) {
String key = enu.nextString();
if (ignoreSet.contains(key))
continue;
nameList.add(key);
valueList.add(ConfigValueUtil.toValue(curMap.get(key)));
defList.add(ConfigValueUtil.toValue(defMap.get(key)));
}
return m;
}
示例7: getThreadList
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public static MapPack getThreadList() {
ThreadMXBean tmb = ManagementFactory.getThreadMXBean();
long[] thread = tmb.getAllThreadIds();
MapPack pack = new MapPack();
ListValue id = pack.newList("id");
ListValue name = pack.newList("name");
ListValue stat = pack.newList("stat");
ListValue cpu = pack.newList("cpu");
for (int i = 0; i < thread.length; i++) {
ThreadInfo fo = tmb.getThreadInfo(thread[i]);
id.add(fo.getThreadId());
name.add(fo.getThreadName());
stat.add(fo.getThreadState().toString());
cpu.add(tmb.getThreadCpuTime(thread[i]) / 1000000);
}
return pack;
}
示例8: getKeyValueInfo
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public MapValue getKeyValueInfo() {
StringKeyLinkedMap<Object> defMap = ConfigValueUtil.getConfigDefault(new Configure(true));
StringKeyLinkedMap<Object> curMap = ConfigValueUtil.getConfigDefault(this);
MapValue m = new MapValue();
ListValue nameList = m.newList("key");
ListValue valueList = m.newList("value");
ListValue defList = m.newList("default");
StringEnumer enu = defMap.keys();
while (enu.hasMoreElements()) {
String key = enu.nextString();
if (ignoreSet.contains(key))
continue;
nameList.add(key);
valueList.add(ConfigValueUtil.toValue(curMap.get(key)));
defList.add(ConfigValueUtil.toValue(defMap.get(key)));
}
return m;
}
示例9: retrieveVisitorRealTimeByObjHashes
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public long retrieveVisitorRealTimeByObjHashes(List<Integer> objHashes, final Server server) {
MapPack param = new MapPack();
ListValue listValue = new ListValue();
for (Integer obj : objHashes) {
listValue.add(obj);
}
param.put(ParamConstant.OBJ_HASH, listValue);
Value value;
try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) {
value = tcpProxy.getSingleValue(RequestCmd.VISITOR_REALTIME_GROUP, param);
}
return ((DecimalValue) value).value;
}
示例10: getVisitorHourlyGroupPack
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private MapPack getVisitorHourlyGroupPack(VisitorGroupRequest visitorGroupRequest) {
MapPack param = new MapPack();
ListValue listValue = new ListValue();
String objHashes = visitorGroupRequest.getObjHashes();
long stime = visitorGroupRequest.getStartYmdH();
long etime = visitorGroupRequest.getEndYmdH();
List<Integer> objList = ZZ.splitParamAsInteger(objHashes);
if (CollectionUtils.isEmpty(objList)) {
throw ErrorState.VALIDATE_ERROR.newBizException("Query parameter 'objHashes' is required!");
}
for (Integer obj : objList) {
listValue.add(obj);
}
param.put(ParamConstant.OBJ_HASH, listValue);
param.put(ParamConstant.STIME, stime);
param.put(ParamConstant.ETIME, etime);
return param;
}
示例11: retrieveText
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public void retrieveText(DictionaryRequest dictionaryRequest, INetReader reader) {
try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(dictionaryRequest.getServerId())) {
for (Map.Entry<String, Set<SDictionaryText>> textSetEntry : dictionaryRequest.getDictSets().entrySet()) {
MapPack paramPack = new MapPack();
paramPack.put(ParamConstant.DATE, dictionaryRequest.getYyyymmdd());
paramPack.put(ParamConstant.TEXT_TYPE, textSetEntry.getKey());
ListValue dictKeyLV = paramPack.newList(ParamConstant.TEXT_DICTKEY);
for (SDictionaryText dictionaryText : textSetEntry.getValue()) {
dictKeyLV.add(dictionaryText.getDictKey());
}
tcpProxy.process(RequestCmd.GET_TEXT_PACK, paramPack, reader);
}
}
}
示例12: handlePageableXLog
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
/**
* retrieve XLog List for paging access
*
* @param pageableXLogRequest
*/
public void handlePageableXLog(final PageableXLogRequest pageableXLogRequest, final INetReader reader) {
MapPack paramPack = new MapPack();
paramPack.put(ParamConstant.DATE, pageableXLogRequest.getYyyymmdd());
paramPack.put(ParamConstant.XLOG_START_TIME, pageableXLogRequest.getStartTimeMillis());
paramPack.put(ParamConstant.XLOG_TXID, pageableXLogRequest.getLastTxid());
paramPack.put(ParamConstant.XLOG_END_TIME, pageableXLogRequest.getEndTimeMillis());
paramPack.put(ParamConstant.XLOG_LAST_BUCKET_TIME, pageableXLogRequest.getLastXLogTime());
paramPack.put(ParamConstant.XLOG_PAGE_COUNT, pageableXLogRequest.getPageCount());
ListValue objHashLv = paramPack.newList(ParamConstant.OBJ_HASH);
for (Integer hash : pageableXLogRequest.getObjHashes()) {
objHashLv.add(hash);
}
PageableXLogView view = new PageableXLogView();
List<SXLog> xLogList = new ArrayList<>();
view.setXLogs(xLogList);
try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(pageableXLogRequest.getServerId())) {
tcpProxy.process(RequestCmd.TRANX_LOAD_TIME_GROUP_V2, paramPack, reader);
}
}
示例13: getAndClearError
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public SummaryPack getAndClearError(byte type) {
if (errorMaster.size() == 0)
return null;
LongKeyLinkedMap<ErrorData> temp = errorMaster;
errorMaster = new LongKeyLinkedMap<ErrorData>().setMax(conf._summary_error_max_count);
SummaryPack p = new SummaryPack();
p.stype = type;
int cnt = temp.size();
ListValue id = p.table.newList("id");
ListValue error = p.table.newList("error");
ListValue service = p.table.newList("service");
ListValue message = p.table.newList("message");
ListValue count = p.table.newList("count");
ListValue txid = p.table.newList("txid");
ListValue sql = p.table.newList("sql");
ListValue apicall = p.table.newList("apicall");
ListValue fullstack = p.table.newList("fullstack");
Enumeration<LongKeyLinkedEntry<ErrorData>> en = temp.entries();
for (int i = 0; i < cnt; i++) {
LongKeyLinkedEntry<ErrorData> ent = en.nextElement();
long key = ent.getKey();
ErrorData data = ent.getValue();
id.add(key);
error.add(data.error);
service.add(data.service);
message.add(data.message);
count.add(data.count);
txid.add(data.txid);
sql.add(data.sql);
apicall.add(data.apicall);
fullstack.add(data.fullstack);
}
return p;
}
示例14: 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);
}
}
示例15: assginGroups
import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public void assginGroups(int objHash, String[] groups) {
ListValue groupList = new ListValue();
for (String group : groups) {
groupList.add(group);
}
objGroupMap.put(String.valueOf(objHash), groupList);
saveGroupFile();
}