Question

I have created a @PerformanceTest annotation which leverages @Before and @After to automatically capture jProfiler metrics. The goal is to apply this annotation to selenium test case(s) running in a separate JVM.

The framework is complete but I can't figure out for the life of me how to connect to my webserver (on the same machine, but in a separate JVM).

I have tried to connect to the port number as so as well as attempting a local connection with no luck.

@BeforeClass
public static void beforePerformanceClass() throws IOException {
    connection = ConnectionFactory.createRemoteConnection("localhost", 8849, 5);
}

My webserver configuration is below. Note that I have tried both offline and online configuration:

-Xshareclasses:none -agentpath:C:\PROGRA~1\JPROFI~1\bin\windows\jprofilerti.dll=port=8849,nowait,id=149,config=C:\Users\username\JPROFI~1\config.xml

What am I missing?

Was it helpful?

Solution

The API is not intended to be used that way. The ConnectionFactory class would only be useful if you write you own profiler based on the API.

You would have to use method triggers for this use case. This means that you have to specify the methods in the method trigger rather than using an annotation. See here for more on trigger configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top