public static void asyncPossibleInstanceInitInvoked(Object keyObject) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(keyObject)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String initObjName = keyObject.toString().replace("$ByteBuddy", "").replace("$$Lambda", "$$L"); initObjName = AgentCommonConstant.normalizeHashCode(initObjName); threadCallPossibleStep.hash = DataProxy.sendApicall(initObjName); ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(keyObject), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1204", "Exception: asyncPossibleInstanceInitInvoked", t); } }
public static void asyncPossibleInstanceInitInvoked(Object keyObject) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(keyObject)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String initObjName = keyObject.toString().replace("$ByteBuddy", "").replace("$$Lambda", "$$L"); initObjName = AgentCommonConstant.normalizeHashCode(initObjName); threadCallPossibleStep.hash = DataProxy.sendApicall(initObjName); ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(keyObject), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1204", "Exception: asyncPossibleInstanceInitInvoked", t); } }
public static void callRunnableInitInvoked(Object callRunnableObj) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(callRunnableObj)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callRunnableObj.toString(); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callRunnableObj), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1203", "Exception: callRunnableInitInvoked", t); } }
public static void callRunnableInitInvoked(Object callRunnableObj) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(callRunnableObj)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callRunnableObj.toString(); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callRunnableObj), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1203", "Exception: callRunnableInitInvoked", t); } }
public static void executorServiceExecuted(Object callRunnable) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (callRunnable == null) return; if (callRunnable instanceof WrTaskCallable) return; if (TransferMap.get(System.identityHashCode(callRunnable)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.threaded = 1; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callRunnable.getClass().getName(); threadCallName = StringUtil.removeLastString(threadCallName, '/'); threadCallName = threadCallName.replace("$$Lambda", "$$L"); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callRunnable), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1204", "Exception: executorServiceExecuted", t); } }
public static void springAsyncExecutionSubmit(Object _this, Callable callable) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(callable)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.threaded = 1; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callable.toString(); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callable), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1202", "Exception: springAsyncExecutionSubmit", t); } }
public static void springAsyncExecutionSubmit(Object _this, Callable callable) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (TransferMap.get(System.identityHashCode(callable)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.threaded = 1; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callable.toString(); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callable), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1202", "Exception: springAsyncExecutionSubmit", t); } }
public static void executorServiceExecuted(Object callRunnable) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; if (callRunnable == null) return; if (callRunnable instanceof WrTaskCallable) return; if (TransferMap.get(System.identityHashCode(callRunnable)) != null) { return; } long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid; ctx.gxid = gxid; long callee = KeyGen.next(); ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep(); threadCallPossibleStep.txid = callee; threadCallPossibleStep.threaded = 1; threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime); String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callRunnable.getClass().getName(); threadCallName = StringUtil.removeLastString(threadCallName, '/'); threadCallName = threadCallName.replace("$$Lambda", "$$L"); threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName); ctx.lastThreadCallName = null; threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName); threadCallPossibleStep.nameTemp = threadCallName; ctx.profile.add(threadCallPossibleStep); TransferMap.put(System.identityHashCode(callRunnable), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep); } catch (Throwable t) { Logger.println("B1204", "Exception: executorServiceExecuted", t); } }
public void forward(WrContext wctx, int uuid) { TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.APP_SERVICE); ApiCallStep step = new ApiCallStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void forwardThread(WrContext wctx, int uuid) {
public void forward(WrContext wctx, int uuid) { TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.APP_SERVICE); ApiCallStep step = new ApiCallStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void forwardThread(WrContext wctx, int uuid) {
public void forwardThread(WrContext wctx, int uuid) { if (wctx == null) return; TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.BACK_THREAD); ThreadSubmitStep step = new ThreadSubmitStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void receive(WrContext ctx, int uuid) {
public void forwardThread(WrContext wctx, int uuid) { if (wctx == null) return; TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.BACK_THREAD); ThreadSubmitStep step = new ThreadSubmitStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void receive(WrContext ctx, int uuid) {
id.tcStep.hash = DataProxy.sendApicall(serviceName);
public static void dispatchAsyncServlet(Object asyncContext, String url) { if (http == null) return; TraceContext ctx = http.getTraceContextFromAsyncContext(asyncContext); if (ctx == null) return; boolean self = http.isSelfDispatch(asyncContext); if (self) { //http.setSelfDispatch(asyncContext, false); //return; } if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); http.setDispatchTransferMap(asyncContext, ctx.gxid, ctx.txid, callee, XLogTypes.ASYNCSERVLET_DISPATCHED_SERVICE); DispatchStep step = new DispatchStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); // It maybe another thread if (ctx.profile_thread_cputime) { step.start_cpu = -1; step.cputime = -1; } step.address = "dispatch"; if (self) url = "[self]"; step.hash = DataProxy.sendApicall(step.address + "://" + url); ctx.profile.add(step); }
id.tcStep.hash = DataProxy.sendApicall(serviceName);
public static void dispatchAsyncServlet(Object asyncContext, String url) { if (http == null) return; TraceContext ctx = http.getTraceContextFromAsyncContext(asyncContext); if (ctx == null) return; boolean self = http.isSelfDispatch(asyncContext); if (self) { //http.setSelfDispatch(asyncContext, false); //return; } if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); http.setDispatchTransferMap(asyncContext, ctx.gxid, ctx.txid, callee, XLogTypes.ASYNCSERVLET_DISPATCHED_SERVICE); DispatchStep step = new DispatchStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); // It maybe another thread if (ctx.profile_thread_cputime) { step.start_cpu = -1; step.cputime = -1; } step.address = "dispatch"; if (self) url = "[self]"; step.hash = DataProxy.sendApicall(step.address + "://" + url); ctx.profile.add(step); }
step.address = tctx.apicall_target; step.hash = DataProxy.sendApicall(tctx.apicall_name); tctx.apicall_name = null; tctx.apicall_target = null;
step.address = tctx.apicall_target; step.hash = DataProxy.sendApicall(tctx.apicall_name); tctx.apicall_name = null; tctx.apicall_target = null;
public void forwardThread(WrContext wctx, int uuid) { if (wctx == null) return; TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.BACK_THREAD); ThreadSubmitStep step = new ThreadSubmitStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void receive(WrContext ctx, int uuid) {
public void forward(WrContext wctx, int uuid) { TraceContext ctx = wctx.inner(); if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } long callee = KeyGen.next(); TransferMap.put(uuid, ctx.gxid, ctx.txid, callee, XLogTypes.APP_SERVICE); ApiCallStep step = new ApiCallStep(); step.txid = callee; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendApicall("local-forward"); ctx.profile.add(step); } public void forwardThread(WrContext wctx, int uuid) {