0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Periodically dump StackProf profile result to tmp directory with easy-to-understand filename
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0.2.12
 Project Readme

Rack::Stackprof

Periodically dump StackProf profile result to tmp with easy-to-understand filenames

Installation

Add this line to your application's Gemfile:

gem 'rack-stackprof'

And then execute:

$ bundle

Usage

if ENV['STACKPROF_ENABLE'] == 'true'
  Rails.application.middleware.use(
    Rack::Stackprof,
    profile_interval_seconds: 1,
    sampling_interval_microseconds: 1000,
    result_directory: 'tmp',
  )
end

After starting application with environment variable STACKPROF_ENABLE=true, files whose name is like following ones will be periodically (once per second as profile_interval_seconds: 1) dumped to tmp.

stackprof-20171004_175816-41860-GET_v1_users-0308ms.dump
stackprof-20171004_175924-41860-GET_v1_accounts-0248ms.dump
stackprof-20171004_175955-41860-GET_v1_comments-1029ms.dump
...

License

The gem is available as open source under the terms of the MIT License.