Class: WPAR::ResourceControl
- Inherits:
-
Object
- Object
- WPAR::ResourceControl
- Defined in:
- lib/wpars/resource_control.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#memory ⇒ Object
Returns the value of attribute memory.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pct_msgids ⇒ Object
readonly
Returns the value of attribute pct_msgids.
-
#pct_pinmem ⇒ Object
readonly
Returns the value of attribute pct_pinmem.
-
#pct_semids ⇒ Object
readonly
Returns the value of attribute pct_semids.
-
#pct_shmids ⇒ Object
readonly
Returns the value of attribute pct_shmids.
-
#procvirtmem ⇒ Object
readonly
Returns the value of attribute procvirtmem.
-
#rset ⇒ Object
readonly
Returns the value of attribute rset.
-
#shares_cpu ⇒ Object
Returns the value of attribute shares_cpu.
-
#shares_memory ⇒ Object
Returns the value of attribute shares_memory.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#totallargepages ⇒ Object
readonly
Returns the value of attribute totallargepages.
-
#totalprocesses ⇒ Object
readonly
Returns the value of attribute totalprocesses.
-
#totalptys ⇒ Object
readonly
Returns the value of attribute totalptys.
-
#totalthreads ⇒ Object
readonly
Returns the value of attribute totalthreads.
-
#totalvirtmem ⇒ Object
readonly
Returns the value of attribute totalvirtmem.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(params) ⇒ ResourceControl
constructor
A new instance of ResourceControl.
- #wpar_attributes ⇒ Object
Constructor Details
#initialize(params) ⇒ ResourceControl
Returns a new instance of ResourceControl.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/wpars/resource_control.rb', line 9 def initialize(params) @command = params[:command] @name = params[:name] @state = params[:state] @active = params[:active] @rset = params[:rset] @shares_cpu = params[:shares_cpu] @cpu = params[:cpu] @shares_memory = params[:shares_memory] @memory = params[:memory] @procvirtmem = params[:procvirtmem] @totalvirtmem = params[:totalvirtmem] @totalprocesses = params[:totalprocesses] @totalptys = params[:totalptys] @totallargepages = params[:totallargepages] @pct_msgids = params[:pct_msgids] @pct_semids = params[:pct_semids] @pct_pinmem = params[:pct_pinmem] @totalthreads = params[:totalthreads] @pct_shmids = params[:pct_shmids] end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
3 4 5 |
# File 'lib/wpars/resource_control.rb', line 3 def active @active end |
#cpu ⇒ Object
Returns the value of attribute cpu.
7 8 9 |
# File 'lib/wpars/resource_control.rb', line 7 def cpu @cpu end |
#memory ⇒ Object
Returns the value of attribute memory.
7 8 9 |
# File 'lib/wpars/resource_control.rb', line 7 def memory @memory end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/wpars/resource_control.rb', line 3 def name @name end |
#pct_msgids ⇒ Object (readonly)
Returns the value of attribute pct_msgids.
5 6 7 |
# File 'lib/wpars/resource_control.rb', line 5 def pct_msgids @pct_msgids end |
#pct_pinmem ⇒ Object (readonly)
Returns the value of attribute pct_pinmem.
6 7 8 |
# File 'lib/wpars/resource_control.rb', line 6 def pct_pinmem @pct_pinmem end |
#pct_semids ⇒ Object (readonly)
Returns the value of attribute pct_semids.
5 6 7 |
# File 'lib/wpars/resource_control.rb', line 5 def pct_semids @pct_semids end |
#pct_shmids ⇒ Object (readonly)
Returns the value of attribute pct_shmids.
6 7 8 |
# File 'lib/wpars/resource_control.rb', line 6 def pct_shmids @pct_shmids end |
#procvirtmem ⇒ Object (readonly)
Returns the value of attribute procvirtmem.
4 5 6 |
# File 'lib/wpars/resource_control.rb', line 4 def procvirtmem @procvirtmem end |
#rset ⇒ Object (readonly)
Returns the value of attribute rset.
3 4 5 |
# File 'lib/wpars/resource_control.rb', line 3 def rset @rset end |
#shares_cpu ⇒ Object
Returns the value of attribute shares_cpu.
7 8 9 |
# File 'lib/wpars/resource_control.rb', line 7 def shares_cpu @shares_cpu end |
#shares_memory ⇒ Object
Returns the value of attribute shares_memory.
7 8 9 |
# File 'lib/wpars/resource_control.rb', line 7 def shares_memory @shares_memory end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/wpars/resource_control.rb', line 3 def state @state end |
#totallargepages ⇒ Object (readonly)
Returns the value of attribute totallargepages.
5 6 7 |
# File 'lib/wpars/resource_control.rb', line 5 def totallargepages @totallargepages end |
#totalprocesses ⇒ Object (readonly)
Returns the value of attribute totalprocesses.
4 5 6 |
# File 'lib/wpars/resource_control.rb', line 4 def totalprocesses @totalprocesses end |
#totalptys ⇒ Object (readonly)
Returns the value of attribute totalptys.
5 6 7 |
# File 'lib/wpars/resource_control.rb', line 5 def totalptys @totalptys end |
#totalthreads ⇒ Object (readonly)
Returns the value of attribute totalthreads.
6 7 8 |
# File 'lib/wpars/resource_control.rb', line 6 def totalthreads @totalthreads end |
#totalvirtmem ⇒ Object (readonly)
Returns the value of attribute totalvirtmem.
4 5 6 |
# File 'lib/wpars/resource_control.rb', line 4 def totalvirtmem @totalvirtmem end |
Instance Method Details
#empty? ⇒ Boolean
31 32 33 |
# File 'lib/wpars/resource_control.rb', line 31 def empty? wpar_attributes.all?{|k,v| self.send(k).nil?} end |
#wpar_attributes ⇒ Object
35 36 37 38 |
# File 'lib/wpars/resource_control.rb', line 35 def wpar_attributes attrs = ResourceControl.instance_methods(false) - [:name, :command, :state, :empty?, :wpar_attributes ] attrs - attrs.grep(/=$/) end |