Class: Mysql::Statsd::Runner
- Inherits:
-
Object
- Object
- Mysql::Statsd::Runner
- Defined in:
- lib/mysql-statsd.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config_path) ⇒ Runner
constructor
A new instance of Runner.
- #mysql ⇒ Object
- #run! ⇒ Object
- #statsd ⇒ Object
Constructor Details
#initialize(config_path) ⇒ Runner
Returns a new instance of Runner.
11 12 13 |
# File 'lib/mysql-statsd.rb', line 11 def initialize(config_path) @config ||= YAML.load_file config_path end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/mysql-statsd.rb', line 9 def config @config end |
Instance Method Details
#mysql ⇒ Object
25 26 27 |
# File 'lib/mysql-statsd.rb', line 25 def mysql @mysql ||= Mysql2::Client.new config['mysql'] end |
#run! ⇒ Object
15 16 17 18 19 |
# File 'lib/mysql-statsd.rb', line 15 def run! instrument_statuses instrument_process_list instrument_queries end |
#statsd ⇒ Object
21 22 23 |
# File 'lib/mysql-statsd.rb', line 21 def statsd @statsd ||= ::Statsd.new(config['statsd']['host']).tap { |sd| sd.namespace = config['statsd']['namespace'] } end |