opus111
opus111

Reputation: 2854

How to aggregate REST calls in JProfiler

I just upgraded to version 9 of your product. I am profiling a REST service.

My CPU profile shows entries such as this

HTTP: /bridge/rest/identity/feature/account/2052814
HTTP: /bridge/rest/identity/feature/account/2052821
HTTP: /bridge/rest/identity/feature/account/2052808
...

However, I am really interested in the amount of time consumed by all calls to HTTP:/bridge/rest/identity/feature/account

How can get JProfiler to aggregate REST calls with some pattern. e.g. HTTP: /bridge/rest/identity/feature/account/*

Upvotes: 2

Views: 769

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48090

JProfiler's servlet probe allows you to configure URL splitting in the session settings:

enter image description here

By default, URL splitting takes the request URI which is what you see in your call tree.

If you switch to the "Resolve with script" option, you can group URLs differently, for example by

servletRequest.getRequestURI().replaceFirst("/\\d+$", "")

which strips a trailing numeric path component.

enter image description here

What's more, you can actually split into multiple levels, and you would do that by adding more scripts to the splitting sequence:

enter image description here

In this case, you would first get groups for GET/PUT/POST etc. and nested below them the single URLs.

Upvotes: 1

Related Questions