add stackprof
This commit is contained in:
parent
2f19ba3357
commit
ea23fd3b7e
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ vendor
|
|||
config/skylight.yml
|
||||
.coverage
|
||||
*.env
|
||||
tmp
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -30,6 +30,7 @@ gem 'metriks-librato_metrics', github: 'eric/metriks-librato_metrics'
|
|||
gem 'micro_migrations'
|
||||
gem 'simplecov'
|
||||
gem 'skylight', '~> 0.6.0.beta.1'
|
||||
gem 'stackprof'
|
||||
|
||||
group :test do
|
||||
gem 'rspec', '~> 2.13'
|
||||
|
|
|
@ -305,6 +305,7 @@ GEM
|
|||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
stackprof (0.2.7)
|
||||
thin (1.6.3)
|
||||
daemons (~> 1.0, >= 1.0.9)
|
||||
eventmachine (~> 1.0)
|
||||
|
@ -364,6 +365,7 @@ DEPENDENCIES
|
|||
sinatra
|
||||
sinatra-contrib
|
||||
skylight (~> 0.6.0.beta.1)
|
||||
stackprof
|
||||
travis-api!
|
||||
travis-config (~> 0.1.0)
|
||||
travis-core!
|
||||
|
|
|
@ -79,6 +79,13 @@ module Travis::Api
|
|||
|
||||
def initialize
|
||||
@app = Rack::Builder.app do
|
||||
|
||||
if ENV['STACKPROF']
|
||||
require 'stackprof'
|
||||
puts "Setting up stack profiling."
|
||||
use StackProf::Middleware, enabled: true, save_every: 1, mode: :object
|
||||
end
|
||||
|
||||
extend StackInstrumentation
|
||||
use Travis::Api::App::Middleware::Skylight
|
||||
use(Rack::Config) { |env| env['metriks.request.start'] ||= Time.now.utc }
|
||||
|
|
Loading…
Reference in New Issue
Block a user