Sha256: 20afa1f7590edd6e3be0b62381fd45b24c5059d839918e9893c6816595b82987

Contents?: true

Size: 992 Bytes

Versions: 3

Compression:

Stored size: 992 Bytes

Contents

# Rack::Stackprof

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

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'rack-stackprof'
```

And then execute:

```bash
$ bundle
```

## Usage

```rb
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](https://opensource.org/licenses/MIT).

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-stackprof-0.2.1 README.md
rack-stackprof-0.2.0 README.md
rack-stackprof-0.1.0 README.md