Class: ActionCost::StatsCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/action_cost/stats_collector.rb

Instance Method Summary collapse

Constructor Details

#initializeStatsCollector

Returns a new instance of StatsCollector.



3
4
5
# File 'lib/action_cost/stats_collector.rb', line 3

def initialize
  @stats = {}
end

Instance Method Details

#dataObject



16
17
18
# File 'lib/action_cost/stats_collector.rb', line 16

def data
  @stats
end

#logObject



12
13
14
# File 'lib/action_cost/stats_collector.rb', line 12

def log
  pp @stats
end

#push(request) ⇒ Object



7
8
9
10
# File 'lib/action_cost/stats_collector.rb', line 7

def push(request)
  ca = controller_action_string(request)
  add_request(ca, request.operation_stats, request.table_stats)
end