In Telemetry§
See primary documentation in context for routine snap.
multi snap(--> Nil) multi snap(Str:D $message --> Nil) multi snap(Str $message = "taking heap snapshot...", :$heap!) multi snap(@s --> Nil)
The snap
subroutine is shorthand for creating a new Telemetry
object and pushing it to an array for later processing. It is exported by default. From release 2021.12, it returns the filename it's storing the snapshots in the case it's provided with a :$heap
associative parameter.
use Telemetry; my @t; for ^5 { snap(@t); # do some stuff LAST snap(@t); }
If no array is specified, it will use an internal array for convenience.