package instrumented
- Alphabetic
- Public
- Protected
Type Members
- case class MethodCallTrace(className: String, methodName: String, methodDescriptor: String) extends Product with Serializable
- class Profiler extends AnyRef
A simple profiler class that counts method invocations.
A simple profiler class that counts method invocations. It is being used in byte-code instrumentation by inserting call to
String, String)
at the beginning of every instrumented class.WARNING: This class is INTERNAL implementation detail and should never be used directly. It's made public only because it must be universally accessible for instrumentation needs. If you want to profile your test use
Instrumentation
instead.
Value Members
- object Instrumentation
An object that controls profiling of instrumented byte-code.
An object that controls profiling of instrumented byte-code. The instrumentation is achieved by using
java.lang.instrument
package. The instrumentation agent can be found inscala.tools.partest.javaagent
package.At the moment the following classes are being instrumented: * all classes with empty package * all classes from scala package (except for classes responsible for instrumentation)
The canonical way of using instrumentation is have a test-case in
files/instrumented
directory. The following code in main:import scala.tools.partest.instrumented.Instrumentation._ def main(args: Array[String]): Unit = { startProfiling() // should box the boolean println(true) stopProfiling() printStatistics() }
should print:
true Method call statistics: scala/Predef$.println(Ljava/lang/Object;)V: 1 scala/runtime/BoxesRunTime.boxToBoolean(Z)Ljava/lang/Boolean;: 1
- object MethodCallTrace extends java.io.Serializable