File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ gem 'yajl-ruby', '~> 1.4.0'
2727# heroku
2828gem 'unicorn' , '~> 4.6.2'
2929
30+ gem 'jemalloc' , git : 'https://github.com/joshk/jemalloc-rb'
31+
3032group :development , :test do
3133 gem 'pry'
3234 gem 'rspec' , '~> 2.9'
Original file line number Diff line number Diff line change 1+ GIT
2+ remote: https://github.com/joshk/jemalloc-rb
3+ revision: 8c9dbef98f6bd4f96b371ec336b7e0c4fdc02d49
4+ specs:
5+ jemalloc (1.4.5 )
6+
17GIT
28 remote: https://github.com/travis-ci/travis-support
39 revision: 113cff17fe383bb72fcfae3a97a8ce98c228342f
@@ -92,6 +98,7 @@ DEPENDENCIES
9298 activesupport (~> 4.1.11 )
9399 backports (= 2.4.0 )
94100 foreman (~> 0.41.0 )
101+ jemalloc !
95102 metriks
96103 metriks-librato_metrics
97104 pry
Original file line number Diff line number Diff line change 1- web : bundle exec unicorn -p $PORT -c ./config/unicorn.rb
1+ web : bundle exec je unicorn -p $PORT -c ./config/unicorn.rb
22console : bundle exec irb -I lib -r travis/listener
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class App < Sinatra::Base
4343
4444 # the main endpoint for scm services
4545 post '/' do
46+ report_memory_usage
4647 report_ip_validity
4748 if !ip_validation? || valid_ip?
4849 if valid_request?
@@ -216,6 +217,10 @@ def request_body
216217 request . body . read . force_encoding ( "utf-8" )
217218 end
218219 end
220+
221+ def report_memory_usage
222+ Metriks . gauge ( "listener.gc.total_allocated_objects" ) . set ( GC . stat [ :total_allocated_objects ] )
223+ end
219224 end
220225 end
221226end
You can’t perform that action at this time.
0 commit comments