File Coverage

blib/lib/Siebel/Srvrmgr/ListParser/Output/ListProcs/Proc.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 16 81.2


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