Class: OFlow::Inspector::TaskStat
- Inherits:
-
Object
- Object
- OFlow::Inspector::TaskStat
- Defined in:
- lib/oflow/inspector.rb
Constant Summary collapse
- STATE_MAP =
{ Task::STARTING => '^', Task::STOPPED => '*', Task::RUNNING => ' ', Task::CLOSING => 'X', Task::BLOCKED => '-', Task::STEP => 's', }
Instance Attribute Summary collapse
-
#activity ⇒ Object
readonly
Returns the value of attribute activity.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#proc_cnt ⇒ Object
readonly
Returns the value of attribute proc_cnt.
-
#queued ⇒ Object
readonly
Returns the value of attribute queued.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(t) ⇒ TaskStat
constructor
A new instance of TaskStat.
- #refresh ⇒ Object
Constructor Details
#initialize(t) ⇒ TaskStat
Returns a new instance of TaskStat.
480 481 482 483 484 485 486 487 488 |
# File 'lib/oflow/inspector.rb', line 480 def initialize(t) @task = t @proc_cnt = t.proc_count() @activity = 0 @queued = t.queue_count() @name = t.full_name @count = @proc_cnt.to_s @state = STATE_MAP.fetch(t.state, '?') end |
Instance Attribute Details
#activity ⇒ Object (readonly)
Returns the value of attribute activity.
466 467 468 |
# File 'lib/oflow/inspector.rb', line 466 def activity @activity end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
469 470 471 |
# File 'lib/oflow/inspector.rb', line 469 def count @count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
467 468 469 |
# File 'lib/oflow/inspector.rb', line 467 def name @name end |
#proc_cnt ⇒ Object (readonly)
Returns the value of attribute proc_cnt.
468 469 470 |
# File 'lib/oflow/inspector.rb', line 468 def proc_cnt @proc_cnt end |
#queued ⇒ Object (readonly)
Returns the value of attribute queued.
465 466 467 |
# File 'lib/oflow/inspector.rb', line 465 def queued @queued end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
470 471 472 |
# File 'lib/oflow/inspector.rb', line 470 def state @state end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
464 465 466 |
# File 'lib/oflow/inspector.rb', line 464 def task @task end |
Instance Method Details
#refresh ⇒ Object
490 491 492 493 494 495 496 497 |
# File 'lib/oflow/inspector.rb', line 490 def refresh() cnt = @task.proc_count() @activity = cnt - @proc_cnt @proc_cnt = cnt @queued = @task.queue_count() @count = cnt.to_s @state = STATE_MAP.fetch(@task.state, '?') end |