Class: Evilution::Parallel::WorkQueue::WorkerStat Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/evilution/parallel/work_queue/worker_stat.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#busy_timeObject

Returns the value of attribute busy_time

Returns:

  • (Object)

    the current value of busy_time



6
7
8
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 6

def busy_time
  @busy_time
end

#items_completedObject

Returns the value of attribute items_completed

Returns:

  • (Object)

    the current value of items_completed



6
7
8
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 6

def items_completed
  @items_completed
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



6
7
8
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 6

def pid
  @pid
end

#wall_timeObject

Returns the value of attribute wall_time

Returns:

  • (Object)

    the current value of wall_time



6
7
8
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 6

def wall_time
  @wall_time
end

Instance Method Details

#idle_timeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 7

def idle_time
  wall_time - busy_time
end

#utilizationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
15
# File 'lib/evilution/parallel/work_queue/worker_stat.rb', line 11

def utilization
  return 0.0 if wall_time.nil? || wall_time.zero?

  busy_time / wall_time
end