Reputation: 246
Steps to reproduce the issue:
The issue is the interceptor is handling the request as a priority but the First API call response is ready in 600ms but it is returning the response once All the request processes, means around 1.6 seconds which is not the correct calculated time.
The logic to calculate the time of API response.
const startTime = new Date().getTime();
next.handle(req).pipe(
map((event) => {
const endTime = new Date().getTime();
const diff = (endTime - startTime)/1000 + 'Seconds';
return event;
})
)
Upvotes: 0
Views: 350
Reputation: 246
I got the issue, on continue from one page to another page I have submitted task API. this submit task API has another API call giftcardcompatability, we are calling this API in async/subscribe mode and we are navigating to the next page based on submitTask API call. When the next page start loads that time lot of Splunk call going to the interceptor and all Splunk call in sync/topromise so it is getting registered in the main flow since giftcardcompatability call is async call so that it is getting registered in event loop and event loop executes after the main loop so the response is coming after sync calls.
Upvotes: 1