Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 /**
  * add xlog profile profile diplay 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);
 }
Ejemplo n.º 3
0
  public TraceContext createChild() {
    TraceContext child = new TraceContext(this.isSummary);
    child.parent = this;
    child.txid = this.txid;
    child.thread = this.thread;
    child.threadId = this.threadId;
    child.gxid = this.gxid;

    // child.profile = this.profile;

    child.startTime = this.startTime;

    if (this.profile_thread_cputime) {
      child.startCpu = SysJMX.getCurrentThreadCPU();
    }
    child.bytes = this.bytes;
    child.status = this.status;

    child.xType = this.xType;
    child.serviceHash = this.serviceHash;
    child.serviceName = this.serviceName;
    child.remoteIp = this.remoteIp;

    child.http_method = this.http_method;
    child.http_query = this.http_query;
    child.http_content_type = this.http_content_type;

    // child.sqlCount = this.sqlCount;
    // child.sqlTime = this.sqlTime;
    // child.sqltext = this.sqltext;
    // child.apicall_name = this.apicall_name;
    // child.apicall_count = this.apicall_count;
    // child.apicall_time = this.apicall_time;

    // child.rs_start = this.rs_start;
    // child.rs_count = this.rs_count;
    // child.sql = this.sql;

    child.userid = this.userid;
    child.userAgent = this.userAgent;
    child.referer = this.referer;
    // child.opencon = this.opencon;
    child.profile_thread_cputime = this.profile_thread_cputime;
    child.is_child_tx = this.is_child_tx;
    child.caller = this.caller;
    child.callee = this.callee;

    return child;
  }
Ejemplo n.º 4
0
  public final void setAutoCommit(boolean a0) throws java.sql.SQLException {
    this.inner.setAutoCommit(a0);

    TraceContext ctx = TraceContextManager.getLocalContext();
    if (ctx == null) return;

    MethodStep p = new MethodStep();
    p.hash = a0 ? HASH_AUTO_COMMIT_TRUE : HASH_AUTO_COMMIT_FALSE;
    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);
  }
Ejemplo n.º 5
0
  public final void commit() throws java.sql.SQLException {
    long stime = System.currentTimeMillis();
    this.inner.commit();
    long etime = System.currentTimeMillis();

    TraceContext ctx = TraceContextManager.getLocalContext();
    if (ctx == null) return;

    MethodStep p = new MethodStep();
    p.hash = HASH_COMMIT;
    p.start_time = (int) (stime - ctx.startTime);
    if (ctx.profile_thread_cputime) {
      p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu);
    }
    p.elapsed = (int) (etime - stime);
    ctx.profile.add(p);
  }