6、ctivity,JDBC)调用(至于这些指标的用处,请参见本文的JDBC插装部分)。为了澄清ThreadMXBean指标的收集方法,清单1快速回顾了基于源代码的插装。在这个例子中,我针对heavilyInstrumentedMethod方法实现了大量插装。清单1.实现大量插装的方法1.protected static AtomicInteger concurrency = new AtomicInteger();2..3..4.for(int x = 0; x < loops; x++) {5. tracer.startThreadInfo
7、Capture(CPU+BLOCK+WAIT);6. int c = concurrency.incrementAndGet();7. tracer.trace(c, "Source Instrumentation", "heavilyInstrumentedMethod", 8. "Concurrent Invocations");9. try {10. // ===================================11. // Here is the method12.