# ThreadDumper
The ThreadDumper plugin starts dumping stack-traces at the given interval.
This version of the ThreadDumper is for Manatee v2.0.
Plugin.start(
"ThreadDumper",
"v0.1.0",
{
maxDepth: 3, // How deep stacktraces to generate, optional
dumpIntervalInSeconds: 10, // How often to dump, optional
dumpAsJson: false, // Dump as JSON, optional
onlyDumpIfCpuExceeds: 0.2 // Only dump if CPU exceeds this threshold (here 20%, single core), optional
}
);
# Module
The ThreadDumper module can be used to dump stack-traces at any time.
var dumper = Module.load("ThreadDumper", "v0.1.0");
var stackTraces = dumper.dump();
You can also use it to record cpu usage:
var dumper = Module.load("ThreadDumper", "v0.1.0");
var usage = dumper.cpu(10); // 10 seconds recording
Usage
is an object with the following properties:
total
: total cpu usageuser
: user cpu usagekernel
: system/privileged/kernel cpu usage
← SectraPlugin Totp →