aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Client/client.rb2
-rw-r--r--db.txt24
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)
diff --git a/db.txt b/db.txt
new file mode 100644
index 0000000..ba7981d
--- /dev/null
+++ b/db.txt
@@ -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
+}