Fiber::ProfilerSourceFiberProfiler

module Profiler

Definitions

def self.default

The default profiler to use, if any.

Use the FIBER_PROFILER_CAPTURE=true environment variable to enable profiling.

Signature

returns Capture | Nil

Implementation

def self.default
	Capture.default
end

def self.capture

Execute the given block with the Fiber::Profiler.default profiler, if any.

Signature

yields {...}

The block to execute.

Implementation

def self.capture
	if capture = self.default
		begin
			capture.start
			
			yield
		ensure
			capture.stop
		end
	else
		yield
	end
end