File Coverage

blib/lib/Linux/loadavg.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Linux::loadavg;
2              
3             our $VERSION = '0.15';
4              
5 1     1   92758 use v5.8;
  1         5  
6 1     1   5 use strict;
  1         5  
  1         24  
7 1     1   4 use warnings;
  1         1  
  1         69  
8 1     1   4 use Carp;
  1         1  
  1         241  
9              
10             require Exporter;
11             require DynaLoader;
12              
13             our @ISA = qw(Exporter DynaLoader);
14              
15             # Items to export into callers namespace by default. Note: do not export
16             # names by default without a very good reason. Use EXPORT_OK instead.
17             # Do not simply export all your public functions/methods/constants.
18              
19             # This allows declaration use Linux::loadavg ':all';
20             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
21             # will save memory.
22             our %EXPORT_TAGS = ( 'all' => [ qw(
23             loadavg
24             LOADAVG_1MIN
25             LOADAVG_5MIN
26             LOADAVG_15MIN
27             ) ] );
28              
29             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
30              
31             our @EXPORT = qw(
32             loadavg
33             LOADAVG_1MIN
34             LOADAVG_5MIN
35             LOADAVG_15MIN
36             );
37              
38 1     1 1 146425 sub LOADAVG_1MIN {0};
39 1     1 1 4 sub LOADAVG_5MIN {1};
40 1     1 1 3 sub LOADAVG_15MIN {2};
41              
42             bootstrap Linux::loadavg $VERSION;
43              
44             # Preloaded methods go here.
45              
46             die "Wrong OS ('$^O' !~ m#(?i)linux#)"
47             unless $^O =~ m#(?i)linux#;
48              
49             1;
50             __END__