Class: Adhearsion::Statistics

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/adhearsion/statistics.rb

Defined Under Namespace

Classes: Dump

Instance Method Summary collapse

Methods included from Celluloid

logger

Constructor Details

#initializeStatistics

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

#dumpAdhearsion::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_sObject Also known as: inspect



78
79
80
# File 'lib/adhearsion/statistics.rb', line 78

def to_s
  "#<#{self.class} dump=#{dump}>"
end