Class: TimeBandits::TimeConsumers::Database
Overview
provide a time consumer interface to ActiveRecord
Instance Method Summary
collapse
fields, format, #initialize, instance, key, method_missing, #metrics, prefix, #runtime
Instance Method Details
#consumed ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/time_bandits/time_consumers/database.rb', line 33
def consumed
time, calls, hits = reset_stats
i = Database.instance
i.sql_query_cache_hits += hits
i.calls += calls
i.time += time
end
|
#current_runtime ⇒ Object
41
42
43
|
# File 'lib/time_bandits/time_consumers/database.rb', line 41
def current_runtime
Database.instance.time + self.class.metrics_store.runtime
end
|
#reset ⇒ Object
28
29
30
31
|
# File 'lib/time_bandits/time_consumers/database.rb', line 28
def reset
reset_stats
super
end
|