lib/Utils/SystemdAnalyze.pm

Utils::SystemdAnalyze

Utils::SystemdAnalyze - Parsers for systemd-analyze text output

extract_analyze_time

my $res = extract_analyze_time($output);

Parse systemd-analyze time output and return a hashref with the kernel, initrd, userspace and overall times in seconds. Lines not containing Startup finished in (e.g. an SSH login banner) are ignored. Returns undef if any of those values is missing or can't be parsed.

extract_blame_time

my $res = extract_blame_time($output);

Parse systemd-analyze blame output and return a hashref mapping each unit to its time in seconds. Lines that aren't <time> <unit> entries, or whose time can't be parsed, are skipped.