cancel
Showing results for 
Search instead for 
Did you mean: 

How to correctly log API call execution time

ed_tc
New Contributor III

Hello everybody,
I want to create some metrics related to API call time.
For now, I am trying to subtract date.now and pipe.startTime using following expression (Math.trunc((Date.now() - pipe.startTime)) ) in mapper preceded by REST POST. Sceleton of pipeline attached. Capture
The issue is this solution not quite accurate. I’ve tried to compare the time that I received by expression and time for snaplogic log and they are different.
Does any body have an idea how to retrieve the correct time in mapper using some expression?
Appreciated for any help.

5 REPLIES 5

ed_tc
New Contributor III

During the testing I found that current solution produce wrong result. API call timeout is 30 seconds, but I can see more than 60 second in which is impossible