本文整理汇总了Java中scouter.util.ThreadUtil.getStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadUtil.getStackTrace方法的具体用法?Java ThreadUtil.getStackTrace怎么用?Java ThreadUtil.getStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scouter.util.ThreadUtil
的用法示例。
在下文中一共展示了ThreadUtil.getStackTrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endPut
import scouter.util.ThreadUtil; //导入方法依赖的package包/类
public static void endPut(Map map) {
int size = map.size();
if(size > 0 && size % conf._hook_map_impl_warning_size == 0) {
TraceContext ctx = TraceContextManager.getContext();
if(ctx == null) return;
if(ctx.error != 0) return;
MapValue mv = new MapValue();
mv.put(AlertPack.HASH_FLAG + TextTypes.SERVICE + "_service-name", ctx.serviceHash);
String message = "Too many Map entries!\n" + ThreadUtil.getStackTrace(Thread.currentThread().getStackTrace(), 2);
HashedMessageStep step = new HashedMessageStep();
step.hash = DataProxy.sendHashedMessage(message);
step.value = size;
step.start_time = (int) (System.currentTimeMillis() - ctx.startTime);
ctx.profile.add(step);
mv.put(AlertPack.HASH_FLAG + TextTypes.HASH_MSG + "_full-stack", step.hash);
DataProxy.sendAlert(AlertLevel.WARN, "TOO_MANY_MAP_ENTRIES", "too many Map entries, over #" + size, mv);
int errorMessageHash = DataProxy.sendError("too many Map entries, over #" + size);
if (ctx.error == 0) {
ctx.error = errorMessageHash;
}
ctx.offerErrorEntity(ErrorEntity.of(tooManyCollectionMemebers, errorMessageHash, 0, 0));
}
}
示例2: add
import scouter.util.ThreadUtil; //导入方法依赖的package包/类
public static void add(byte[] ipaddr, int port, int serviceHash, long txid) {
long key = mkey(ipaddr, port);
Info info = socketMap.get(key);
if (info != null) {
if (info.stackOrder) {
info.service = serviceHash;
info.txid = txid;
info.stackOrder = false;
info.stack = ThreadUtil.getStackTrace(Thread.currentThread().getStackTrace(), 3);
}
if (info.service == 0) {
info.service = serviceHash;
info.txid = txid;
}
info.count++;
} else {
info = new Info(serviceHash, txid);
socketMap.put(key, info);
if (port == Configure.getInstance()._trace_fullstack_socket_open_port) {
info.stack = ThreadUtil.getStackTrace(Thread.currentThread().getStackTrace(), 3);
}
}
}