![]() |
|< 1 2 >| | ![]() |
16 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
my $path = './space/dir/';
my %codes = (
'traffic' => \&traffic ,
'packetloss' => \&packetloss,
'JitterIN' => \&jitter_in,
'jitterOUT' => \&jitter_out ,
'PacketLossIN' => \&packet_loss_in ,
'PacketLossOUT' => \&packet_loss_out ,
);
foreach my $path(keys(%dir)){
(my $pathforcode = $path) =~ /\/(.*?)\/[^\/]*$/;
$codes{$pathforcode}->($path,$dir{$path});
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
my %relationen = (
'jittermaxnegsd'=>{'rel'=>'jittermaxpossd','func'=>\&jitter_out},
'jittermaxpossd'=>{'rel'=>'jittermaxnegsd','func'=>\&jitter_out},
'packetlossin' =>{'rel'=>'packetlossout' ,'func'=>\&packet_loss},
'packetlossout' =>{'rel'=>'packetlossin' ,'func'=>\&packet_loss},
);
my %nonrelation = (
'traffic' => \&traffic,
'cpu' => \&cpu,
);
foreach my $path(keys(%dirs)){
my @pathitems =(split (/\//,$path));
my $typ =$pathitems[-1];
if (exists $relation{$typ})
{
$pathitems[-1]=$relation{$typ}{'rel'};
my $path2 = join('/',@pathitems);
$relation{$typ}{'func'}($path,$dirs{$path},$path2,$dirs{$path2});
}else{ $nonrelation{$typ}($path,$dirs{$path});}
}
![]() |
|< 1 2 >| | ![]() |
16 Einträge, 2 Seiten |