| 1 | package System::Introspector::Probe::FileHandles; | ||
| 2 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 1 | ▶ | use System::Introspector::Util qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | lines_from_command | ||
| 6 | transform_exceptions | ||
| 7 | 1 | ); | |
| 8 | |||
| 9 | 1 | ▶ | has lsof_command => (is => 'ro', default => sub { 'lsof' }); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 2 | ▶ | sub gather { |
|
Subroutine
gather: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 12 | 2 | my ($self) = @_; | |
| 13 | 2 | ▶ | return transform_exceptions { |
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||
| 14 | 2 | my @lines = lines_from_command [$self->_lsof_command_call]; | |
| 15 | 1 | my @handles; | |
| 16 | 1 | for my $line (@lines) { | |
| 17 | 4 | chomp $line; | |
| 18 | 4 | my @fields = split m{\0}, $line; | |
| 19 | push @handles, { map { | ||
| 20 | 4 | m{^(.)(.*)$}; | |
| 21 | 21 | ($1, $2); | |
| 22 | } @fields }; | ||
| 23 | } | ||
| 24 | 1 | return { handles => \@handles }; | |
| 25 | 2 | }; | |
| 26 | } | ||
| 27 | |||
| 28 | 2 | ▶ | sub _lsof_command_call { |
|
Subroutine
_lsof_command_call: called CC=1 SCAR=0.0
| |||
| 29 | 2 | my ($self) = @_; | |
| 30 | 2 | return $self->lsof_command, '-F0'; | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | 1; | |
| 34 | |||
| 35 | __END__ | ||