pub struct RecordConfig {
pub format: OutputFormat,
pub raw_path: Option<PathBuf>,
pub out_path: Option<PathBuf>,
pub pid: Pid,
pub with_subprocesses: bool,
pub sample_rate: u32,
pub maybe_duration: Option<Duration>,
pub flame_min_width: f64,
pub lock_process: bool,
pub force_version: Option<String>,
pub on_cpu_only: bool,
}
Expand description
A configuration bundle for the recorder
Fields§
§format: OutputFormat
The format to use for recorded traces. See OutputFormat
for a list of available options.
raw_path: Option<PathBuf>
Where to write rbspy’s raw trace output, which can be used for later processing.
out_path: Option<PathBuf>
Where to write rbspy’s output. If -
is given, output is written to standard output.
pid: Pid
The process ID (PID) of the process to profile. This is usually a ruby process, but rbspy
will locate and profile any ruby subprocesses of the target process if with_subprocesses
is enabled.
with_subprocesses: bool
Whether to profile the target process (given by pid
) as well as its child processes, and
their child processes, and so on. Default: false
.
sample_rate: u32
The number of traces that should be collected each second. Default: 100
.
maybe_duration: Option<Duration>
The length of time that the recorder should run before stopping. Default: none (run until interrupted).
flame_min_width: f64
Minimum flame width. Applies to flamegraph output only. If your sample has many small functions in it and is difficult to read, then consider increasing this value. Default: 0.1.
lock_process: bool
Locks the process when a sample is being taken.
You should enable this option for the most accurate samples. However, it briefly stops the process from executing and can affect performance. The performance impact is most noticeable in CPU-bound ruby programs or when a high sampling rate is used.
force_version: Option<String>
Forces the recorder to use the given Ruby version. If not given, rbspy will attempt to determine the Ruby version from the running process.
This option shouldn’t be needed unless you’re testing a pre-release Ruby version.
on_cpu_only: bool
Includes stack traces only when the program is using the CPU. Default: false
(always
includes stack traces, even when the program is waiting).