diff options
-rw-r--r-- | Client/client.rb | 2 | ||||
-rw-r--r-- | db.txt | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Client/client.rb b/Client/client.rb index 5b8f26c..8549886 100644 --- a/Client/client.rb +++ b/Client/client.rb @@ -25,7 +25,7 @@ threads["pingthread"] = Thread.new do loop do slock = true results = {"timestamp" => Time.now.to_i} settings["neighbours"].each do |neighbour| - pingtime = %x[ping -c1 #{neighbour}][/time=(.*?) ms/, 1] + pingtime = %x[ping -c1 #{neighbour}][/time=(.*?) ms/, 1].to_f results.merge!({neighbour => pingtime}) end rcoll.insert(results) @@ -0,0 +1,24 @@ +Configs db example + +configs.servera is a collection containing records like: +{ + "timestamp": 1363817460, + "configttl": 3600, + "pinginterval": 60, + "neighbours": [ + "serverb", + "serverc", + "home" + ] +} + + +Results db example + +results.servera is a collection containing records like: +{ + "timestamp": 1363817460, + "serverb": 0.057, + "serverc": 0.054, + "home": 0.055 +} |