Class: Adhearsion::Statistics
- Includes:
- Celluloid
- Defined in:
- lib/adhearsion/statistics.rb
Defined Under Namespace
Classes: Dump
Instance Method Summary collapse
-
#dump ⇒ Adhearsion::Statistics::Dump
Create a point-time dump of process statistics.
-
#initialize ⇒ Statistics
constructor
A new instance of Statistics.
- #to_s ⇒ Object (also: #inspect)
Methods included from Celluloid
Constructor Details
#initialize ⇒ Statistics
Returns a new instance of Statistics.
44 45 46 47 |
# File 'lib/adhearsion/statistics.rb', line 44 def initialize @calls_dialed = @calls_offered = @calls_routed = @calls_rejected = 0 @calls_by_route = Hash.new { |h,k| h[k] = 0 } end |
Instance Method Details
#dump ⇒ Adhearsion::Statistics::Dump
Create a point-time dump of process statistics
53 54 55 |
# File 'lib/adhearsion/statistics.rb', line 53 def dump Dump.new timestamp: Time.now, call_counts: dump_call_counts, calls_by_route: dump_calls_by_route end |
#to_s ⇒ Object Also known as: inspect
78 79 80 |
# File 'lib/adhearsion/statistics.rb', line 78 def to_s "#<#{self.class} dump=#{dump}>" end |