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'
27
27
# heroku
28
28
gem 'unicorn' , '~> 4.6.2'
29
29
30
+ gem 'jemalloc' , git : 'https://github.com/joshk/jemalloc-rb'
31
+
30
32
group :development , :test do
31
33
gem 'pry'
32
34
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
+
1
7
GIT
2
8
remote: https://github.com/travis-ci/travis-support
3
9
revision: 113cff17fe383bb72fcfae3a97a8ce98c228342f
@@ -92,6 +98,7 @@ DEPENDENCIES
92
98
activesupport (~> 4.1.11 )
93
99
backports (= 2.4.0 )
94
100
foreman (~> 0.41.0 )
101
+ jemalloc !
95
102
metriks
96
103
metriks-librato_metrics
97
104
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
2
2
console : 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
43
43
44
44
# the main endpoint for scm services
45
45
post '/' do
46
+ report_memory_usage
46
47
report_ip_validity
47
48
if !ip_validation? || valid_ip?
48
49
if valid_request?
@@ -216,6 +217,10 @@ def request_body
216
217
request . body . read . force_encoding ( "utf-8" )
217
218
end
218
219
end
220
+
221
+ def report_memory_usage
222
+ Metriks . gauge ( "listener.gc.total_allocated_objects" ) . set ( GC . stat [ :total_allocated_objects ] )
223
+ end
219
224
end
220
225
end
221
226
end
You can’t perform that action at this time.
0 commit comments