This is documented at https://rubygems.org/gems/rails-perftest (as of Rails 4, which we're moving to shortly)
@icarito - just a note!
Hi!
I was wondering if I can help out with performance testing? Or should this be worked on after you guys move to Rails 4?
If you would like to write the tests now, are the steps as follows?:
Please let me know!
Monica
We are now on Rails 4.1 and soon to move to 4.2 -- so I think we're ready for this! I think we'll have to "enable" performance tests in the Rakefile, and add that gem. You can probably start with the test that's already there!
Thank you, we'd love the help!
Hi Jeffrey,
Alright, I'll get started, and will let you know if any questions come up along the way.
Super! Thanks!
On Dec 7, 2017 6:45 PM, "Monica Sirathanarun" notifications@github.com
wrote:
Hi Jeffrey,
Alright, I'll get started, and will let you know if any questions come up
along the way.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1801#issuecomment-350129461,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJxB5ExgTEeYPuHMRWKY_YqtNrgDfks5s-Hh8gaJpZM4QrFYj
.
OK, it looks like we'll have to uncomment this test, as I commented it out recently: https://github.com/publiclab/plots2/blob/master/test/performance/browsing_test.rb#L10
Then I guess we can add in this test as part of the Rakefile, as we do here: https://github.com/publiclab/plots2/blob/master/Rakefile#L16-L22
I think the syntax would be task :run => ['test:_run'] ?
Note that if you want to run a test several times, you can do:
100.times do
get '/'
end
It looks like this requires the ruby-prof gem in the Gemfile, too.
This is exciting-- good luck!
Also maybe a good resource: http://railscasts.com/episodes/411-performance-testing?view=asciicast
Hi Jeffrey,
Thank you!
Hi Jeffrey,
I have made changes to the following in a branch called 'performance-test' https://github.com/bellvat/plots2/tree/performance-test :
test "browsers" do, full code here https://github.com/bellvat/plots2/blob/performance-test/test/performance/browsing_test.rbIssue: I did not create a pull request because I was not able to test the changes I made. When I ran $ bundle exec rake test:benchmark, which should give us the performance statistics, I kept getting this error:

rails generate performance_test browsingtests, which was a command I tried in order to see if the bug could have been from the browsing_test.rb. Any guidance would be appreciated!
Thanks for your help!
Hi! Actually please do open a PR, as this is a great way to collaboratively
debug -- we can get a look at how the code behaves in a standard
environment and both look at the full output when our automatic tests run
using Travis. A great service!
I found that the rake tasks didn't automatically run the performance tests
but maybe I did something wrong. In any case we can do this later and also
just see how things go in the PR tests.
Thanks!!!
On Dec 8, 2017 6:52 PM, "Monica Sirathanarun" notifications@github.com
wrote:
Hi Jeffrey,
I have made changes to the following in a branch called 'performance-test'
https://github.com/bellvat/plots2/tree/performance-test http://url :1.
Added perftest gem
2.Added ruby prof gem
3.Uncommented code in browsing_test.rb, and changed syntax of line 9 to:
test "browsers" do, full code here https://github.com/bellvat/
plots2/blob/performance-test/test/performance/browsing_test.rb
http://url
4.I did not make changes to the Rakefile. It seems like the code you
referenced here (https://github.com/publiclab/
plots2/blob/master/Rakefile#L16-L22
https://github.com/publiclab/plots2/blob/master/Rakefile#L16-L22)
would include any tests performed in the performance folder? Please let me
know if I am misunderstanding the code.Issue: I did not create a pull request because I was not able to test
the changes I made. When I ran $ bundle exec rake test:benchmark, which
should give us the performance statistics, I kept getting this error:
[image: screen shot 2017-12-08 at 3 39 52 pm]
https://user-images.githubusercontent.com/26703702/33789543-1a128c4e-dc2e-11e7-8788-cde2dfd25273.png
- I tried to debug this by changing my ruby version, as I read in
some posts that it might be that Rails 4.1.6 may not be compatible with
Ruby 2.4. I am not as familiar with how rbenv works, and although I was
able to install a different version of ruby, I was not able to get rails to
work with that version.- The same error message came up when I tried running rails generate
performance_test browsingtests, which was a command I tried in order
to see if the bug could have been from the browsing_test.rb.Any guidance would be appreciated!
Thanks for your help!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1801#issuecomment-350401450,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ-1acFzXSY4Pii_-UxHKU2Jo8KbQks5s-cumgaJpZM4QrFYj
.
Hmm, "Stack level too deep" is an error that often relates to a recursively
nested bit of code. So maybe that's a clue but we'll see how the PR runs.
On Dec 9, 2017 10:23 AM, "Jeffrey Warren" jeff@unterbahn.com wrote:
Hi! Actually please do open a PR, as this is a great way to
collaboratively debug -- we can get a look at how the code behaves in a
standard environment and both look at the full output when our automatic
tests run using Travis. A great service!I found that the rake tasks didn't automatically run the performance tests
but maybe I did something wrong. In any case we can do this later and also
just see how things go in the PR tests.Thanks!!!
On Dec 8, 2017 6:52 PM, "Monica Sirathanarun" notifications@github.com
wrote:Hi Jeffrey,
I have made changes to the following in a branch called
'performance-test' https://github.com/bellvat/plo
ts2/tree/performance-test http://url :1.
Added perftest gem
2.Added ruby prof gem
3.Uncommented code in browsing_test.rb, and changed syntax of line 9 to:
test "browsers" do, full code here https://github.com/bellvat/plo
ts2/blob/performance-test/test/performance/browsing_test.rb
http://url
4.I did not make changes to the Rakefile. It seems like the code you
referenced here (https://github.com/publiclab/
plots2/blob/master/Rakefile#L16-L22
https://github.com/publiclab/plots2/blob/master/Rakefile#L16-L22)
would include any tests performed in the performance folder? Please let me
know if I am misunderstanding the code.Issue: I did not create a pull request because I was not able to test
the changes I made. When I ran $ bundle exec rake test:benchmark, which
should give us the performance statistics, I kept getting this error:
[image: screen shot 2017-12-08 at 3 39 52 pm]
https://user-images.githubusercontent.com/26703702/33789543-1a128c4e-dc2e-11e7-8788-cde2dfd25273.png
- I tried to debug this by changing my ruby version, as I read in
some posts that it might be that Rails 4.1.6 may not be compatible with
Ruby 2.4. I am not as familiar with how rbenv works, and although I was
able to install a different version of ruby, I was not able to get rails to
work with that version.- The same error message came up when I tried running rails generate
performance_test browsingtests, which was a command I tried in order
to see if the bug could have been from the browsing_test.rb.Any guidance would be appreciated!
Thanks for your help!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1801#issuecomment-350401450,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ-1acFzXSY4Pii_-UxHKU2Jo8KbQks5s-cumgaJpZM4QrFYj
.
Hi Jeffrey,
I have created PR #1861.
Regards,
Monica