Package com.taobao.profile.runtime

Examples of com.taobao.profile.runtime.ThreadData


   * @return
   */
  private void dumpProfileData() {
    ThreadData[] threadData = Profiler.threadProfile;
    for (int index = 0; index < threadData.length; index++) {
      ThreadData profilerData = threadData[index];
      if (profilerData == null) {
        continue;
      }
      ProfStack<long[]> profile = profilerData.profileData;
      while (profile.size() > 0) {
        long[] data = profile.pop();
        StringBuilder sb = new StringBuilder();
        // thread id
        sb.append(index);
        sb.append('\t');
        // stack number
        sb.append(data[1]);
        sb.append('\t');
        // method id
        sb.append(data[0]);
        sb.append('\t');
        // use time
        sb.append(data[2]);
        sb.append('\n');
        fileWriter.append(sb.toString());
      }
      fileWriter.flushAppend();
      profilerData.clear();
    }
    fileWriter.append("=\n");
    fileWriter.flushAppend();
  }
View Full Code Here


      startTime = System.nanoTime();
    } else {
      startTime = System.currentTimeMillis();
    }
    try {
      ThreadData thrData = threadProfile[(int) threadId];
      if (thrData == null) {
        thrData = new ThreadData();
        threadProfile[(int) threadId] = thrData;
      }

      long[] frameData = new long[3];
      frameData[0] = methodId;
View Full Code Here

      endTime = System.nanoTime();
    } else {
      endTime = System.currentTimeMillis();
    }
    try {
      ThreadData thrData = threadProfile[(int) threadId];
      if (thrData == null || thrData.stackNum <= 0 || thrData.stackFrame.size() == 0) {
        // 没有执行start,直接执行end/可能是异步停止导致的
        return;
      }
      // 栈太深则抛弃部分数据
View Full Code Here

    }
  }

  public static void clearData() {
    for (int index = 0; index < threadProfile.length; index++) {
      ThreadData profilerData = threadProfile[index];
      if (profilerData == null) {
        continue;
      }
      profilerData.clear();
    }
  }
View Full Code Here

TOP

Related Classes of com.taobao.profile.runtime.ThreadData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.