tmm1/perftools.rb — Issue #41: CPUPROFILE_REALTIME=1 disables profiling
Author: betelgeuse
Created: 2012-03-08 15:33:08+00:00
State: open

https://github.com/tmm1/perftools.rb/pull/33#issuecomment-4393102

As asked in #33 when when I don't have CPUPROFILE_REALTIME set current master (1742f97b94ce6d7be4365c097d8b8ad62444b846) works fine but when I set it then profiling gets disabled:

```
$ CPUPROFILE_REALTIME=1 PERFTOOLS=true bin/cucumber
Using the default profile...
Disabling profiler because SIGALRM handler is already in use.
```

Here's how perftools.rb is integrated to cucumber

features/support/perftools.rb

```ruby
if ENV['PERFTOOLS']
require 'perftools'

PerfTools::CpuProfiler.start('tmp/cucumber.perf')
at_exit do
PerfTools::CpuProfiler.stop
end
end

```