I am trying to understand how CPU profiling works in JProfiler and for that I created a very simple Rest Service as shown below:
@RestController public class AlertsService { private static final Logger log = LoggerFactory.getLogger(AlertsService.class); @GetMapping("/hello") public String sayHello() throws InterruptedException { log.info("inside hello..."); Thread.sleep(5000); return "hello world"; } } I started the App and then opened JProfiler and I clicked on "Attach" to attach to that service and selected following settings:
Next I went to CPU views and clicked on "record CPU data" 
After that I triggered a request to the endpoint and I got following results:
As we can see we have the com.ramos.loadtest.service.AlertsService.sayHello method being displayed but for some reason it is showing 420 micro seconds in Call Tree View and 12 micro seconds in HotSpot View, what I don't understand is why is not showing at least 5000 milliseconds if that is what was specified in the service call (trying so simulate a long running process). Please help me understand, thank you.


