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

[sui-perf] Support for Axios or promise based libs #79

Closed
naxhh opened this issue Aug 8, 2017 · 2 comments
Closed

[sui-perf] Support for Axios or promise based libs #79

naxhh opened this issue Aug 8, 2017 · 2 comments
Assignees
Labels

Comments

@naxhh
Copy link
Contributor

naxhh commented Aug 8, 2017

sui-perf

sui-perf

Description

Right now sui-perf provides an integration to get superagent requests timings.
We want to add support for Axios

Steps to Reproduce

Expected behavior: Get time marks on axios requests

Actual behavior:
I've made a very quick'n dirt implementation but I've noticed that since they are promises and two promises can be spawned at the same time but resolved in any order, this libs groups them as one call as child of the other one (like with react components)

Example:
/example1 request is performed (perf.mark(/example1)
/example2 request is performed (perf.mark(/example2))
/example2 request done (perf.stop(/example2)
/example1 request done (perf.stop(/example1)

This will be reported as example2 being a child of example1 when the requests are independent to each other.
In my mind this should also happen to superagent implementation on events, but I didn't test it.

@naxhh naxhh added the feature label Aug 8, 2017
@davidbarna
Copy link
Contributor

It's not really reported as a child. It reports each line separately. It can look as a child because example2 begins after example1. Do you mean that example2 in the graph finishes before example 1 ??? It's should not happen.

The only thing that worries me with this integration is what already happens with super-agent. It's because the integration decorates superagent singleton instance. So, in node, we can't really know which page request actually generated API requests.

A way to avoid it is a façade instance of axios or super agent per request, but we would have to modify the domain for that.

Do you have something else in mind ?

@naxhh
Copy link
Contributor Author

naxhh commented Aug 17, 2017

We already have a facade for axios.

Maybe it was our quick implementation that generated a weird behaviour, but we saw the times of request 2 being summed in the total of request 1...

Anyway we can talk about how we can implement this.
I was waiting for you since you know this much better.

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

No branches or pull requests

2 participants