module PerfTools::SchedulerTrace

Overview

Print the current runtime status of execution contexts, their schedulers, down to their individual fibers. If the FiberTrace module has also been loaded, the yield stack of suspended fibers is also printed.

This module only impacts the performance of the program when printing the runtime status.

Defined in:

perf_tools/scheduler_trace.cr

Class Method Summary

Class Method Detail

def self.every(interval : Time::Span, details = false) : Nil #

Starts a thread that will call .print_runtime_status on every interval until the program terminates.

Set details to true to print individual fiber details, and the yield stack of suspended fibers if FiberTrace has also been required.


[View source]
def self.on(signal : Signal, details : Bool = true) : Nil #

Installs a signal handler to call .print_runtime_status on demand.

You can use Signal::USR1 or another Signal. You must be careful not to reuse the signals used by the GC to stop or resume the world (see GC.sig_suspend and GC.sig_resume) that uses different signals depending on the target and configuration.

Set details to true to print individual fiber details, and the yield stack of suspended fibers if FiberTrace has also been required.


[View source]
def self.print_runtime_status(details = false) : Nil #

Stops the world, prints the status of all runtime schedulers to the standard error, then resumes the world.

Set details to true to print individual fiber details, and the yield stack of suspended fibers if FiberTrace has also been required.


[View source]