class Innodb::Stats
Attributes
data[R]
Public Class Methods
get(name)
click to toggle source
Get a statistic by name.
# File lib/innodb/stats.rb, line 20 def self.get(name) @data[name] end
increment(name, value = 1)
click to toggle source
Increment a statistic by name (typically a symbol), optionally by a value provided.
# File lib/innodb/stats.rb, line 15 def self.increment(name, value = 1) @data[name] += value end
print_report(io = $stdout)
click to toggle source
Print a simple report of collected statistics, optionally to the IO object provided, or by default to STDOUT.
# File lib/innodb/stats.rb, line 32 def self.print_report(io = $stdout) io.puts "%-50s%10s" % %w[Statistic Count] @data.sort.each do |name, count| io.puts "%-50s%10i" % [ name, count, ] end nil end
reset()
click to toggle source
Reset all statistics.
# File lib/innodb/stats.rb, line 25 def self.reset @data.clear nil end