Class: HerokuMongoWatcher::Watcher

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku_mongo_watcher/watcher.rb

Class Method Summary collapse

Class Method Details

.configObject



22
23
24
# File 'lib/heroku_mongo_watcher/watcher.rb', line 22

def self.config
  HerokuMongoWatcher::Configuration.instance.config
end

.watchObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/heroku_mongo_watcher/watcher.rb', line 26

def self.watch

  EM::run {


    cmd = "mongostat --rowcount 0 10 --host #{config[:mongo_host]} \
           --username #{config[:mongo_username]} --password #{config[:mongo_password]} --noheaders"

    EM.popen(cmd, MongoStatProcessor)


  }


end