line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Siebel::Srvrmgr::ListParser::Output::ListProcs::Proc; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output::ListProcs::Proc - class to represent instances of processes from "list procs" command |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Siebel::Srvrmgr::OS::Process; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $proc = Siebel::Srvrmgr::OS::Process->new( |
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
pid => 4568, |
16
|
|
|
|
|
|
|
fname => 'siebmtshmw', |
17
|
|
|
|
|
|
|
pctcpu => 0.35, |
18
|
|
|
|
|
|
|
pctmem => 10, |
19
|
|
|
|
|
|
|
rss => 12345, |
20
|
|
|
|
|
|
|
vsz => 123456 |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This module is a L<Moose> class. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Instances of Siebel::Srvrmgr::ListParser::Output::ListProcs::Proc refer to a single line from the output of the C<list procs> command. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This class offers some validations on the values recovered, as well some additional funcionality as methods besides getters/setters. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
8
|
use Moose 2.0401; |
|
1
|
|
|
|
|
20
|
|
|
1
|
|
|
|
|
8
|
|
35
|
1
|
|
|
1
|
|
8364
|
use namespace::autoclean 0.13; |
|
1
|
|
|
|
|
33
|
|
|
1
|
|
|
|
|
12
|
|
36
|
1
|
|
|
1
|
|
147
|
use MooseX::FollowPBP 0.05; |
|
1
|
|
|
|
|
29
|
|
|
1
|
|
|
|
|
16
|
|
37
|
|
|
|
|
|
|
our $VERSION = '0.29'; # VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 server |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
A string representing the name of the server that the proc is associated to. |
46
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has server => ( is => 'ro', isa => 'Str', required => 1 ); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 comp_alias |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
A string of the component alias associated with this proc. |
55
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has comp_alias => ( is => 'ro', isa => 'Str', required => 1 ); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 pid |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
A integer representing the OS PID associated with this proc. |
64
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
has pid => ( is => 'ro', isa => 'Int', required => 1 ); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 sisproc |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
A integer representing the tasks sisproc number (whatever that means). |
73
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
has sisproc => ( is => 'ro', isa => 'Int', required => 1 ); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 normal_tasks |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
A integer representing the number of normal tasks in execution for this proc. |
82
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
has normal_tasks => ( is => 'ro', isa => 'Int', required => 1 ); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 sub_tasks |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
A integer representing the number of subtasks in execution for this proc. |
91
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
has sub_tasks => ( is => 'ro', isa => 'Int', required => 1 ); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 hidden_tasks |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
A integer representing the number of hidden tasks in execution for this proc. |
100
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
has hidden_tasks => ( is => 'ro', isa => 'Int', required => 1 ); |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 vm_free |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
A integer representing the process virtual memory free pages. |
109
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
has vm_free => ( is => 'ro', isa => 'Int', required => 1 ); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 vm_used |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
A integer representing the process virtual memory used pages. |
118
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
has vm_used => ( is => 'ro', isa => 'Int', required => 1 ); |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 pm_used |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
A integer representing the process physical memory used pages. |
127
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
has pm_used => ( is => 'ro', isa => 'Int', required => 1 ); |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head2 proc_enabled |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
A boolean value that identifies if this process is enabled to have tasks. |
136
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
has proc_enabled => |
141
|
|
|
|
|
|
|
( is => 'ro', isa => 'Bool', required => 1, reader => 'is_proc_enabled' ); |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head2 run_state |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
A string representing the state of the process. |
146
|
|
|
|
|
|
|
It is a required attribute during object creation, and is read-only. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
has run_state => ( is => 'ro', isa => 'Str', required => 1 ); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 sockets |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
A integer representing the number of sockets received for this process. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
has sockets => ( is => 'ro', isa => 'Int', required => 1 ); |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=pod |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 METHODS |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
All attributes have their respective getter methods (C<get_ATTRIBUTE_NAME>) |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head2 get_all_tasks |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Returns the sum of the values of the attributes C<normal_tasks>, C<sub_tasks> and C<hidden_tasks>. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub get_all_tasks { |
173
|
|
|
|
|
|
|
|
174
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
return ( $self->get_normal_tasks() + |
177
|
|
|
|
|
|
|
$self->get_sub_tasks() + $self->get_hidden_tasks() ); |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=pod |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 SEE ALSO |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=over |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=item * |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
L<MooseX::FollowPBP> |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
L<Moose> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item * |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
L<Siebel::Srvrmgr::ListParser::Output::Tabular::ListProcs> |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=back |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 AUTHOR |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
This file is part of Siebel Monitoring Tools. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
Siebel Monitoring Tools is free software: you can redistribute it and/or modify |
212
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
213
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
214
|
|
|
|
|
|
|
(at your option) any later version. |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
Siebel Monitoring Tools is distributed in the hope that it will be useful, |
217
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
218
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
219
|
|
|
|
|
|
|
GNU General Public License for more details. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
222
|
|
|
|
|
|
|
along with Siebel Monitoring Tools. If not, see L<http://www.gnu.org/licenses/>. |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=cut |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |