public void profile(String msg) { MessageStep p = new MessageStep(); p.message = msg; p.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(p); }
public void profile(String msg) { MessageStep p = new MessageStep(); p.message = msg; p.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(p); }
public static void addMessage(String msg) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; MessageStep p = new MessageStep(); p.message = msg; p.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(p); }
public static void endMethod(Object localContext, Throwable thr) { if (localContext == null) return; LocalContext lctx = (LocalContext) localContext; if (lctx.service) { endService(lctx, null, thr); return; } MethodStep step = (MethodStep) lctx.stepSingle; if (step == null) return; TraceContext tctx = lctx.context; if (tctx == null) return; step.elapsed = (int) (System.currentTimeMillis() - tctx.startTime) - step.start_time; if (tctx.profile_thread_cputime) { step.cputime = (int) (SysJMX.getCurrentThreadCPU() - tctx.startCpu) - step.start_cpu; } tctx.profile.pop(step); }
public static void addMessage(String msg) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return; MessageStep p = new MessageStep(); p.message = msg; p.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(p); }
public static void endMethod(Object localContext, Throwable thr) { if (localContext == null) return; LocalContext lctx = (LocalContext) localContext; if (lctx.service) { endService(lctx, null, thr); return; } MethodStep step = (MethodStep) lctx.stepSingle; if (step == null) return; TraceContext tctx = lctx.context; if (tctx == null) return; step.elapsed = (int) (System.currentTimeMillis() - tctx.startTime) - step.start_time; if (tctx.profile_thread_cputime) { step.cputime = (int) (SysJMX.getCurrentThreadCPU() - tctx.startCpu) - step.start_cpu; } tctx.profile.pop(step); }
public static void jspServlet(Object[] arg) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null || arg.length < 3) return; HashedMessageStep step = new HashedMessageStep(); step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendHashedMessage("JSP " + arg[2]); ctx.profile.add(step); }
/** * add xlog profile * profile display like --> msg #value elapsed * @param msg message * @param value any value to display on a profile. * @param elapsed any value to display on a profile. */ public void hashProfile(String msg, int value, int elapsed) { HashedMessageStep step = new HashedMessageStep(); step.hash = DataProxy.sendHashedMessage(msg); step.value = value; step.time = elapsed; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(step); }
/** * add xlog profile * profile display like --> msg #value elapsed * @param msg message * @param value any value to display on a profile. * @param elapsed any value to display on a profile. */ public void hashProfile(String msg, int value, int elapsed) { HashedMessageStep step = new HashedMessageStep(); step.hash = DataProxy.sendHashedMessage(msg); step.value = value; step.time = elapsed; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(step); }
public static void jspServlet(Object[] arg) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null || arg.length < 3) return; HashedMessageStep step = new HashedMessageStep(); step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.hash = DataProxy.sendHashedMessage("JSP " + arg[2]); ctx.profile.add(step); }
public static Object startApicall(String name, long apiTxid) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return null; if (ctx.apicall_name != null) { return null; } ApiCallStep step = new ApiCallStep(); step.txid = apiTxid; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.push(step); ctx.apicall_name = name; return new LocalContext(ctx, step); }
public static Object startApicall(String name, long apiTxid) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) return null; if (ctx.apicall_name != null) { return null; } ApiCallStep step = new ApiCallStep(); step.txid = apiTxid; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.push(step); ctx.apicall_name = name; return new LocalContext(ctx, step); }
public static Object startApicall(String className, String methodName, String methodDesc, Object _this, Object[] arg) { try { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) { return null; } if (ctx.apicall_name != null) { return null; } HookArgs hookPoint = new HookArgs(className, methodName, methodDesc, _this, arg); ApiCallStep step = ApiCallTraceHelper.start(ctx, hookPoint); if (step == null) return null; step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.push(step); return new LocalContext(ctx, step, hookPoint); } catch (Throwable sss) { sss.printStackTrace(); } return null; }
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) {
/** * add xlog profile * profile display like --> #elasped(if the value is not -1) formatted message * @param msg message format (ex- "Hello, my name is %s and my age is %s)" * @param elapsed any value to display on a profile. * @param params message format parameters. */ public void parameterizedProfile(int level, String msg, int elapsed, String... params) { ParameterizedMessageStep step = new ParameterizedMessageStep(); step.setMessage(DataProxy.sendHashedMessage(msg), params); step.setElapsed(elapsed); step.setLevel(ParameterizedMessageLevel.of(level)); step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(step); }
/** * add xlog profile * profile display like --> #elasped(if the value is not -1) formatted message * @param msg message format (ex- "Hello, my name is %s and my age is %s)" * @param elapsed any value to display on a profile. * @param params message format parameters. */ public void parameterizedProfile(int level, String msg, int elapsed, String... params) { ParameterizedMessageStep step = new ParameterizedMessageStep(); step.setMessage(DataProxy.sendHashedMessage(msg), params); step.setElapsed(elapsed); step.setLevel(ParameterizedMessageLevel.of(level)); step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } ctx.profile.add(step); }
public static Object start(Object o) { TraceContext ctx = TraceContextManager.getContext(); if (ctx == null) { return null; } SqlStep3 step = new SqlStep3(); step.start_time = (int) (System.currentTimeMillis() - ctx.startTime); if (ctx.profile_thread_cputime) { step.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu); } step.xtype = SqlXType.DYNA; ctx.sqlActiveArgs = ctx.sql; String sql = "unknown"; sql = ctx.sql.getSql(); sql = escapeLiteral(sql, step); step.param = ctx.sql.toString(step.param); if (sql != null) { step.hash = DataProxy.sendSqlText(sql); } ctx.profile.push(step); ctx.sqltext = sql; return new LocalContext(ctx, step); }