Start a new topic

How to measure custom endpoint respond time?

 Hi, I would like to know if there is any way to measure how much time does an endpoint takes since it receives a request until it responds. I've been trying using the moment() module but it doesn't seem to give a constant time.

1 Comment

Hi Andres,


You can accurately determine the execution time for the custom endpoint by using moment module in BL to print start time at the start of the execution and end time right before response.complete/response.error is called.


If you are calling third party services for data or doing other asynchronous activities, the execution time will differ a little every time depending on time taken to complete such tasks.


Can you answer a couple of my questions:

  1. What's the use case for this custom endpoint?
  2. Why do you want to measure this execution time?
  3. What's the difference in time you noticed when you tested?

Regards,
Wani
Kinvey Support

Login or Signup to post a comment