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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8aceefe4b2198adee91edcd59c34c2ac3570efb6
4
- data.tar.gz: 4779b126e67dd77f1cd5ff408509c5de68026be2
3
+ metadata.gz: 2617a76bb6cafa7bc588830643570593285112ee
4
+ data.tar.gz: fd0dc6dc1c0d773538acf0621fc84c1671ad61ca
5
5
  SHA512:
6
- metadata.gz: 82497ecfe03dcc767ab1fd1e917b23c2399ea22f9a3208d8ec995e1c59542c15d60eebee339ffe6046ceed8f2844a110396c2cae2cc4bfd1f2ef3387d40ebb50
7
- data.tar.gz: 67767a1c2725905d4d301d81f9445d4f97f2cceef7b633554f67ca13918a80ec7d2535ed500ec6df7324006e19ed213d9e733815bbdad57a471b2114853f82ef
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.firt
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, :status, :probe_responses
32
+ attr_accessor :responsetime, :probe_responses
32
33
 
33
34
  def avgresponse
34
- data = responsetime['avgresponse'] || []
35
- data.map do |v|
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)
@@ -1,3 +1,3 @@
1
1
  module Pingdom
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
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.7
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-09-14 00:00:00.000000000 Z
11
+ date: 2017-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler