easymon 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of easymon might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37ad20e40a9eb00cac3ff063616b106d614a72ba
4
- data.tar.gz: b90df46d842ff9cb52e9f6bb34fdcd166e4c11a0
3
+ metadata.gz: 9e3c6dbe76e00da8ea581456f3629db07caf8feb
4
+ data.tar.gz: 3ebe3496b6880dc63b076c92c1e319a406a3865b
5
5
  SHA512:
6
- metadata.gz: 132bbbd21819511b28bea2e5ce627259ef37286cddf3a2c6ca17b3eea2ccf6b92af28c32ce800f7524a77af645cfebccbdc7211d4ef446b9b194242506a80b04
7
- data.tar.gz: 071967341f3c6a779c8748209223541fa9ca8ce62b1b6df872bf0b93c7af28d7078fdb0843f56c72b61ef13a8d767753650a71e12341c758a1a6df45edec75cf
6
+ metadata.gz: 42a4731f64e2201753c66dccf6132d12073505f583425e2a20f505fb403561704600d33b702870614ecf247029224b5211ea39163af38a32e02accc3a1304483
7
+ data.tar.gz: e8a181963593e0367d5563c62bc06504af6cacb27ae4f5e557155947f8cb378c9c4112208c7990aa39f7099aaa55c6b6c3dddbdce85d575b9eaed8b43233cebb
@@ -24,7 +24,7 @@ module Easymon
24
24
  end
25
25
 
26
26
  def timing
27
- results.values.map{|r| r.timing}.reduce(:+)
27
+ results.values.map{|r| r.timing}.inject(0, :+)
28
28
  end
29
29
 
30
30
  def to_text
@@ -32,13 +32,13 @@ module Easymon
32
32
  end
33
33
 
34
34
  def to_s
35
- self.results.map{|name, result| "#{name}: #{result.to_s}"}.join("\n") +
36
- "\n - Total Time - " + self.timing.to_s + "s"
35
+ results.map{|name, result| "#{name}: #{result.to_s}"}.join("\n") +
36
+ "\n - Total Time - " + Easymon.timing_to_ms(self.timing) + "ms"
37
37
  end
38
38
 
39
39
  def to_json(*args)
40
40
  combined = []
41
- self.results.each do |name, result|
41
+ results.each do |name, result|
42
42
  combined << result.to_hash.merge({"name" => name})
43
43
  end
44
44
  combined.to_json
@@ -19,7 +19,7 @@ module Easymon
19
19
  end
20
20
 
21
21
  def to_s
22
- "#{message} - #{timing.to_s}s"
22
+ "#{message} - #{Easymon.timing_to_ms(timing)}ms"
23
23
  end
24
24
 
25
25
  def to_json(options = {})
@@ -27,8 +27,7 @@ module Easymon
27
27
  end
28
28
 
29
29
  def to_hash
30
- {:success => success, :message => message, :timing => timing}
30
+ {:success => success, :message => message, :timing => timing_to_ms(timing)}
31
31
  end
32
-
33
32
  end
34
33
  end
@@ -1,3 +1,3 @@
1
1
  module Easymon
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
data/lib/easymon.rb CHANGED
@@ -61,4 +61,8 @@ module Easymon
61
61
  end
62
62
  end
63
63
  end
64
+
65
+ def self.timing_to_ms(timing = 0)
66
+ sprintf("%.3f", (timing * 1000))
67
+ end
64
68
  end
@@ -731,3 +731,23 @@ Started GET "/up/index.json" for 127.0.0.1 at 2014-05-27 18:56:07 -0400
731
731
  Processing by Easymon::ChecksController#show as JSON
732
732
  Parameters: {"check"=>"index"}
733
733
  Completed 404 Not Found in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
734
+  (0.2ms) SELECT 1=1
735
+  (0.2ms) SELECT 1=1
736
+  (0.2ms) SELECT 1=1
737
+  (0.3ms) SELECT 1=1
738
+  (0.2ms) SELECT 1=1
739
+  (0.2ms) SELECT 1=1
740
+ 0.002186
741
+ 0.011523
742
+ 0.000727
743
+ 0.001202
744
+  (0.2ms) SELECT 1=1
745
+ 0.0024
746
+ 0.011956
747
+ 0.000711
748
+ 0.001118
749
+ {}
750
+ true
751
+ {}
752
+ {}
753
+ {}