class DucksboardReporter::Reporters::MySqlBase

Public Instance Methods

collect() click to toggle source
# File lib/ducksboard_reporter/reporters/mysql_base.rb, line 9
def collect
  update # this is important!
  every(period) do
    update
  end
end
gather_stats() click to toggle source
# File lib/ducksboard_reporter/reporters/mysql_base.rb, line 32
def gather_stats
  raise NotImplementedError
end
moderated_stats() click to toggle source
# File lib/ducksboard_reporter/reporters/mysql_base.rb, line 27
def moderated_stats
  # default is to just take the absolute value
  @current_stats
end
period() click to toggle source
# File lib/ducksboard_reporter/reporters/mysql_base.rb, line 5
def period
  1
end
update() click to toggle source
# File lib/ducksboard_reporter/reporters/mysql_base.rb, line 16
def update
  begin
    @current_stats = gather_stats
  rescue Errno::ENOENT
    error("MysqlQueriesPerSecond: failed to use mysqladmin status")
    return
  end

  self.value = moderated_stats
end