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

Response Time information for a request #21

Closed
TachyonFlare opened this issue Sep 16, 2014 · 4 comments
Closed

Response Time information for a request #21

TachyonFlare opened this issue Sep 16, 2014 · 4 comments

Comments

@TachyonFlare
Copy link

Does unirest have any api to know the response time for call ?

@heyman
Copy link

heyman commented Sep 16, 2014

I don't know if they measure the time and expose it through their API. From glancing over http://unirest.io/python.html it doesn't look like they do.

Fortunately it's trivial to measure it yourself like this:

from time import time
start_time = time()
unirest.get(...)
elapsed_time_ms = (time() - start_time()) * 1000

See the documentation for more info on how to write a custom client for Locust:
http://docs.locust.io/en/latest/testing-other-systems.html

@TachyonFlare
Copy link
Author

Actually this requirement is due to locustio/locust#197 (comment) , since i am unable to schedule the calls in advance using locust, I am trying to use nodejs as an alternative for my requirement. I dint want to add the timer functions everywhere i make a call , so i wanted to know if unirest exposed any such api.

@heyman
Copy link

heyman commented Sep 17, 2014

Oh, sorry, I ended up on this issue from a link (probably from your github22 profile page) and somehow mistakenly thought this was an issue created under the Locust project.

My bad, you can ignore my above comment then :).

@nijikokun
Copy link
Contributor

I think the best way is to do it like @heyman has mentioned

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

3 participants