The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

use strict;
use Test::More tests => 5;
my @cpustats = qw(
user
nice
system
idle
total
);
my $sys = Sys::Statistics::Linux->new();
$sys->set(cpustats => 1);
sleep(1);
my $stats = $sys->get;
ok(defined $stats->cpustats->{cpu}->{$_}, "checking cpustats $_") for @cpustats;