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

Add Feature: Download Report File #1516

Merged
merged 8 commits into from
Aug 18, 2020
Merged

Add Feature: Download Report File #1516

merged 8 commits into from
Aug 18, 2020

Conversation

taojy123
Copy link
Contributor

Export all statistics data to a html file, and you can download it to your computer.

As follows:

download

report

@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #1516 into master will decrease coverage by 0.76%.
The diff coverage is 86.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
- Coverage   82.10%   81.33%   -0.77%     
==========================================
  Files          28       28              
  Lines        2509     2513       +4     
  Branches      381      388       +7     
==========================================
- Hits         2060     2044      -16     
- Misses        354      369      +15     
- Partials       95      100       +5     
Impacted Files Coverage Δ
locust/main.py 20.35% <50.00%> (-0.10%) ⬇️
locust/stats.py 89.47% <54.54%> (-0.97%) ⬇️
locust/web.py 91.32% <97.29%> (+1.16%) ⬆️
locust/clients.py 90.19% <0.00%> (-4.91%) ⬇️
locust/runners.py 81.74% <0.00%> (-1.69%) ⬇️
locust/user/task.py 96.15% <0.00%> (-1.15%) ⬇️
locust/contrib/fasthttp.py 84.97% <0.00%> (-0.47%) ⬇️
locust/rpc/zmqrpc.py 86.20% <0.00%> (-0.46%) ⬇️
locust/util/cache.py 90.90% <0.00%> (-0.40%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bc5c5e...ee069eb. Read the comment docs.

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

Hmm... you're adding an entirely new greenlet for this feature. Would it be possible to do this outside locust core?

I'm not sure the maintenance will be worth it...

@taojy123
Copy link
Contributor Author

Sorry, I didn't get the point.
Is it that stats_history_greenlet is not a good way to do this?
How can I improve the code, Thankyou~

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

My main issue is that I dont use the web UI, so I usually cant be bothered with these things :)

I'm +/- 0 for this. It looks nice enough. If any of the other maintainers wake up and want to merge this then I'm fine with it.

@taojy123
Copy link
Contributor Author

oh, haha~ I see, thanks 😁

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

I couldnt help myself and had a look at the report. It looks great.

If you just fix the test fail that appeared I will merge!

@taojy123
Copy link
Contributor Author

I just fixed the conflict, but the coverage decrease 1.18% 😅
I'll try to add some testcases.

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

Ignore the coverage changes, it is a little flaky...

@taojy123

This comment has been minimized.

@taojy123
Copy link
Contributor Author

done! 😄

@cyberw cyberw merged commit e13b536 into locustio:master Aug 18, 2020
@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

thx!

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

Hmm... I get warnings from tox/travis about this file descriptor never being closed. Can you fix it?

/home/travis/build/locustio/locust/locust/web.py:217: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/travis/build/locustio/locust/locust/static/jquery-1.11.3.min.js' mode='r' encoding='utf8'>

@taojy123
Copy link
Contributor Author

Ok!
It would be better to replace

with open(path, encoding='utf8') as f:
    content = f.read()

with

content = open(path, encoding='utf8').read()

in stats_report function.

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

Yes. But the opposite of what you just said. So I hope that was what you meant :)

@cyberw
Copy link
Collaborator

cyberw commented Aug 18, 2020

I accidentally pushed a commit to your master (taojy123/master) Sorry about that 😳

(I'm surprised I was even allowed to)

@taojy123
Copy link
Contributor Author

Ha~ don't worry
And I committed the change to taojy123/locust,
taojy123@a1e6e65

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

Successfully merging this pull request may close these issues.

2 participants