Class: Adhearsion::Statistics::Dump
- Includes:
- Comparable
- Defined in:
- lib/adhearsion/statistics.rb
Overview
A point-time dump of process statistics
Instance Attribute Summary collapse
-
#call_counts ⇒ Hash
Hash of call counts during the lifetime of the process.
-
#calls_by_route ⇒ Hash
Hash of call counts during the lifetime of the process, indexed by the route they matched.
-
#timestamp ⇒ Time
The time at which this dump was generated.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(opts = {}) ⇒ Dump
constructor
A new instance of Dump.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(opts = {}) ⇒ Dump
Returns a new instance of Dump.
117 118 119 120 121 |
# File 'lib/adhearsion/statistics.rb', line 117 def initialize(opts = {}) @timestamp = opts[:timestamp] @call_counts = opts[:call_counts] @calls_by_route = opts[:calls_by_route] end |
Instance Attribute Details
#call_counts ⇒ Hash
Returns hash of call counts during the lifetime of the process.
110 111 112 |
# File 'lib/adhearsion/statistics.rb', line 110 def call_counts @call_counts end |
#calls_by_route ⇒ Hash
Returns hash of call counts during the lifetime of the process, indexed by the route they matched.
115 116 117 |
# File 'lib/adhearsion/statistics.rb', line 115 def calls_by_route @calls_by_route end |
#timestamp ⇒ Time
Returns the time at which this dump was generated.
105 106 107 |
# File 'lib/adhearsion/statistics.rb', line 105 def @timestamp end |
Instance Method Details
#<=>(other) ⇒ Object
123 124 125 |
# File 'lib/adhearsion/statistics.rb', line 123 def <=>(other) <=> other. end |
#to_s ⇒ Object Also known as: inspect
127 128 129 130 131 132 |
# File 'lib/adhearsion/statistics.rb', line 127 def to_s attrs = [:timestamp, :call_counts, :calls_by_route].map do |attr| "#{attr}=#{send(attr).inspect}" end "#<#{self.class} #{attrs.join ', '}>" end |