hertzsprung
hertzsprung

Reputation: 9893

How to profile wall clock time of tests running in maven surefire

I'm trying to profile a suite of tests that are being run from maven surefire. I've found related questions such as this and this nothing quite what I'm looking for.

Can someone recommend a profiler that will let me measure wall clock durations of method calls of the test suite (that is, I'm not trying to attach the profiler to an already-running application)?

Upvotes: 3

Views: 1892

Answers (1)

hertzsprung
hertzsprung

Reputation: 9893

This answer has helped me. I've added the following to my pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <argLine>-agentpath:/home/jshaw/yjp-12.0.2/bin/linux-x86-64/libyjpagent.so=tracing,onexit=snapshot,disablej2ee</argLine>
    </configuration>
</plugin>

Then you can load the snapshots from YourKit profiler after maven has finished running.

Upvotes: 1

Related Questions