title: Performance measurement for Java based rest api
body: <p>I have written a Java based rest API project. I want to test the performance for the API.</p>
  
  <p>Here performance can be divided into two.</p>
  
  <ol>
  <li>Request to response time.</li>
  <li>Actual code execution time.</li>
  </ol>
  
  <p>I know how to test or measure #1 but I am not sure how to measure #2.</p>
  
  <p>More info for #2</p>
  
  <p>Suppose I have a method which is mapped to rest end point. </p>
  
  <p>I want to know how much time was spent in</p>
  
  <ol>
  <li>Parsing data to method params</li>
  <li>Executing the code in the method</li>
  <li>Amount of time spent in converting the response back to JSON</li>
  </ol>
  
  <p>Thanks</p>