metracer – No Runtime Dependencies + Nice Indentation

Based on my experiments with adoption of metracer to JavaEE (link) a new version of metracer 1.0.5 was released. Source code of new 1.0.5 version: svn co

This version (1.0.5) brings two notable changes:

  • no runtime dependencies are needed anymore for instrumented code. I.e. com.develorium.metracer.TracingState and com.develorium.metracer.TracingStateThreadLocal are eliminated. This means that it’s now possible to use metracer for JavaEE applications without the need to create artificial modules and modify dependencies of deployment units! All is needed is to pass metracer to JVM via javaagent opt!
  • nice indentation of log entries which greatly eases logs reading. E.g.:
#java -javaagent:$(find ~/.m2 -name metracer-1.0.5.jar)=pattern=com.develorium -cp target/metracertest-1.0.0.jar com.develorium.metracertest.Unannotated
+++[0] com.develorium.metracertest.Unannotated.main(args = [Ljava.lang.String;@6f2b958e)
+++[1] com.develorium.metracertest.Unannotated.testA()
---[1] com.develorium.metracertest.Unannotated.testA
+++[1] com.develorium.metracertest.Unannotated.testB(theBool1 = false, theBool2 = true)
---[1] com.develorium.metracertest.Unannotated.testB
result of testB = 42
+++[1] com.develorium.metracertest.Unannotated.testC(theInt = 42, theFloat = 2.718, theDouble = 3.1415)
+++[2] com.develorium.metracertest.Unannotated.testInnerC()
+++[3] com.develorium.metracertest.Unannotated.testFaulty()
---[3] com.develorium.metracertest.Unannotated.testFaulty (by exception)
---[2] com.develorium.metracertest.Unannotated.testInnerC
---[1] com.develorium.metracertest.Unannotated.testC
---[0] com.develorium.metracertest.Unannotated.main

More fun with metracer is coming soon. Stay tuned!


Leave a Reply

Your email address will not be published.