pingdom 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/pingdom/summary_average.rb +16 -4
- data/lib/pingdom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2617a76bb6cafa7bc588830643570593285112ee
|
4
|
+
data.tar.gz: fd0dc6dc1c0d773538acf0621fc84c1671ad61ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ecff5b56f9c60169658593af8adae5403bab9e2b785f4c5f9a7eddaef49efeabf128ff2806290c2aa090ded69e5a9a51d0995b85e11d2ae870d90268569e6c
|
7
|
+
data.tar.gz: 8c6ebcd34b3f0f1f5be7d55d6ada0e585d6270bdcbbad541873991bc5111dc05fd52dc634e345daf947218ade08ba2f9b9bd08750aa2f208233cd524ffa01fc1
|
data/README.md
CHANGED
@@ -75,7 +75,7 @@ average.from # is a Time
|
|
75
75
|
average.to # is a Time
|
76
76
|
=> 2017-09-05 15:43:53 +0100
|
77
77
|
|
78
|
-
average.avgresponse # is a Integer
|
78
|
+
average.responsetime.avgresponse # is a Integer
|
79
79
|
=> 381
|
80
80
|
|
81
81
|
# with parameters
|
@@ -95,7 +95,7 @@ average.status.totalunknown
|
|
95
95
|
average = Pingdom::SummaryAverage.find check_id, bycountry: true
|
96
96
|
|
97
97
|
average.avgresponse # is an Array of Struct::AvgResponse
|
98
|
-
r = average.avgresponse.
|
98
|
+
r = average.avgresponse.first
|
99
99
|
r.country
|
100
100
|
=> 'UK'
|
101
101
|
|
@@ -2,6 +2,7 @@ module Pingdom
|
|
2
2
|
|
3
3
|
Struct.new('AvgResponse',:countryiso, :avgresponse)
|
4
4
|
Struct.new('ProbeResponse',:id, :avgresponse,:from,:n, :to)
|
5
|
+
Struct.new('AverageStatus',:totalup, :totaldown,:totalunknown)
|
5
6
|
|
6
7
|
class SummaryAverage < Pingdom::Base
|
7
8
|
|
@@ -28,15 +29,26 @@ module Pingdom
|
|
28
29
|
|
29
30
|
end
|
30
31
|
|
31
|
-
attr_accessor :responsetime, :
|
32
|
+
attr_accessor :responsetime, :probe_responses
|
32
33
|
|
33
34
|
def avgresponse
|
34
|
-
data = responsetime['avgresponse']
|
35
|
-
|
35
|
+
data = responsetime['avgresponse']
|
36
|
+
|
37
|
+
data.map! do |v|
|
36
38
|
Struct::AvgResponse.new(v['countryiso'], v['avgresponse'])
|
37
|
-
end
|
39
|
+
end if data.is_a?(Array)
|
40
|
+
data
|
41
|
+
end
|
42
|
+
|
43
|
+
def status= v
|
44
|
+
@status=Struct::AverageStatus.new(v['totalup'],v['totaldown'],v['totalunknown'])
|
38
45
|
end
|
39
46
|
|
47
|
+
def status
|
48
|
+
@status
|
49
|
+
end
|
50
|
+
|
51
|
+
|
40
52
|
def probe_responses
|
41
53
|
responsetime.each_pair.map do |k,v|
|
42
54
|
next if %q(from to).include?(k)
|
data/lib/pingdom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pingdom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Piccinini Lagos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|