Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts/angular/logging-http-response-times-angular/ #13

Open
utterances-bot opened this issue Sep 4, 2019 · 5 comments
Open

posts/angular/logging-http-response-times-angular/ #13

utterances-bot opened this issue Sep 4, 2019 · 5 comments

Comments

@utterances-bot
Copy link

Logging HTTP Response Times in Angular

In this post, we will look at how you can measurethe time it takes to send and receive HTTP responses, from the frontend and logging them.

https://codinglatte.com/posts/angular/logging-http-response-times-angular/

Copy link

why do you send startTimestamp with headers? its closure-like, you can use startTimestamp directly

Copy link

How to record response time for more than 1 API calls on one page? I have 3 API calls. I want to sum of all 3 response time and show in front-end. Any suggestion?

@mainawycliffe
Copy link
Member

Are you running them sequentially or in parallel?

@pathikvejani
Copy link

parallel.

@mainawycliffe
Copy link
Member

You could possibly use the CombineLatest creation operator to bundle the observables, and this will give you access to the time taken by each request, in the header and then depending on how you want to handle it, you can calculate how long it took to execute the request i.e. take the earliest start timestamp and the latest timestamp and subtract the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants