| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package GRID::Cluster::Result; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use GRID::Machine::MakeAccessors; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use GRID::Machine::Message; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
17
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use GRID::Machine::Result; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
6
|
1
|
|
|
|
|
10
|
use overload q("") => 'str', |
|
7
|
1
|
|
|
1
|
|
5
|
bool => 'allfirstok'; |
|
|
1
|
|
|
|
|
1
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Constructor |
|
10
|
|
|
|
|
|
|
sub new { |
|
11
|
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
|
13
|
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my $self = {}; |
|
15
|
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
bless $self, $class; |
|
17
|
0
|
|
|
|
|
|
return $self; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Adds a new GRID::Machine::Result object to a GRID::Cluster::Result object |
|
21
|
|
|
|
|
|
|
sub add { |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
24
|
0
|
|
|
|
|
|
my %args = @_; |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
my $host_name = $args{host_name} if defined($args{host_name}); |
|
27
|
0
|
0
|
|
|
|
|
my $machine_result = $args{machine_result} if defined($args{machine_result}); |
|
28
|
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$self->{$host_name} = $machine_result; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Methods |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# This method returns a reference to a list of trues or falses, |
|
36
|
|
|
|
|
|
|
# depending on there were / weren't errors during executions |
|
37
|
|
|
|
|
|
|
sub result { |
|
38
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
39
|
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return [ map { $self->{$_}->result } keys %{$self} ]; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# This method returns true if all the values of the list returned by |
|
44
|
|
|
|
|
|
|
# the method "results" are true. |
|
45
|
|
|
|
|
|
|
# This method is used for overloading the bool operator |
|
46
|
|
|
|
|
|
|
sub allfirstok { |
|
47
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my @results = @{$self->result}; |
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my @falses = grep { !$_ } @results; |
|
|
0
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return !@falses; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# This method is used for overloading the q("") operator |
|
57
|
|
|
|
|
|
|
sub str { |
|
58
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
59
|
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my $string = ""; |
|
61
|
0
|
|
|
|
|
|
my @host_names = keys %{$self}; |
|
|
0
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
foreach (@host_names) { |
|
64
|
0
|
|
|
|
|
|
$string .= "$_: ".$self->{$_}->str."\n"; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $string; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |