uptrends_extended 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/uptrends_extended/base.rb +10 -2
- data/lib/uptrends_extended/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzQ4Y2E4MWQzMmY1MTZjMTNiNjU3OTM4NjkzZTYxY2YyOTlkYTgyZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDc2YjY4ZGVlNmY1ZDU1MzJiNDU2ZGZiODllZjcxNTRjOTIwZGU2NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzYyNDNjODUzZDczOGI4ZWMzNGYxOWZjODNhZTk3YWVmNGIwMGQzMmEwODYz
|
10
|
+
M2NjNzg1OTVkNmFiYjRlMjU3NTM4ZjE3Zjk1ZDNmYzhlMjRiNGIzZjJhMTcy
|
11
|
+
MjM1YmY1MGQwMGYzMTJiNTk0YTk3YjE0MmE4OTA5ODg0ODI0OTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODQzYzVmNjIyMmJiNWM4ZjU3MDY5NjQ4MDQyZGI1ZDY4OWRhY2ZlYjExN2I0
|
14
|
+
ZmNlMzJjMjEzNGY0ODA5YjVlMTU3MTYxNjY1ZTk1MzUwOGE5NWUyOGE3ODVj
|
15
|
+
ZWE4YzQ3ZWIyYmFmZGQyYjQ2MzM1NTllN2E4NzVjMzE3OTUxMDc=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# UptrendsExtended Gem Changelog
|
2
2
|
|
3
|
+
## 0.7.1
|
4
|
+
- Handling the case where the probe has been created but no data have yet been collected
|
5
|
+
|
3
6
|
## 0.7.0
|
4
7
|
- Added the statistics part, so you are able to get statistics about probes and probegroups
|
5
8
|
- Minor syntax fixes for rails 3 and up
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Uptrends RESTful API Client
|
2
2
|
|
3
|
-
[![Code Climate](https://codeclimate.com/github/microting/uptrends-gem/badges/gpa.svg)](https://codeclimate.com/github/microting/uptrends-gem) [![Test Coverage](https://codeclimate.com/github/microting/uptrends-gem/badges/coverage.svg)](https://codeclimate.com/github/microting/uptrends-gem/coverage) [![Build Status](https://travis-ci.org/microting/uptrends-gem.svg)](https://travis-ci.org/microting/uptrends-gem) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/microting/uptrends-gem/blob/master/LICENSE.txt)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/microting/uptrends-gem/badges/gpa.svg)](https://codeclimate.com/github/microting/uptrends-gem) [![Test Coverage](https://codeclimate.com/github/microting/uptrends-gem/badges/coverage.svg)](https://codeclimate.com/github/microting/uptrends-gem/coverage) [![Build Status](https://travis-ci.org/microting/uptrends-gem.svg)](https://travis-ci.org/microting/uptrends-gem) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/microting/uptrends-gem/blob/master/LICENSE.txt) [![Gem Version](https://badge.fury.io/rb/uptrends_extended.svg)](http://badge.fury.io/rb/uptrends_extended)
|
4
4
|
|
5
5
|
This is a ruby wrapper around the [Uptrends API][2]. Uptrends is a monitoring service that let's you monitor Web pages, Web services, Mail servers, Database servers, DNS, SSL certificates, FTP and more.
|
6
6
|
|
@@ -48,13 +48,21 @@ module UptrendsExtended
|
|
48
48
|
|
49
49
|
def uptime_this_year
|
50
50
|
stats = statistics("#{Time.now.year}/01/01", "#{Time.now.year}/12/31", 'Year')
|
51
|
-
|
51
|
+
if stats.blank?
|
52
|
+
{sla: 0, uptime: 0} # We return this because the probe has not been tested yet.
|
53
|
+
else
|
54
|
+
{sla: stats[0]['SLAPercentage'], uptime: stats[0]['PercentageUptime']}
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def uptime_last_12_months
|
55
59
|
start_period = Time.now - 12.months
|
56
60
|
stats = statistics(start_period.strftime('%Y/%m/%d'), Time.now.strftime('%Y/%m/%d'), 'Year')
|
57
|
-
|
61
|
+
if stats.blank?
|
62
|
+
{sla: 0, uptime: 0} # We return this because the probe has not been tested yet.
|
63
|
+
else
|
64
|
+
{sla: stats[0]['SLAPercentage'], uptime: stats[0]['PercentageUptime']}
|
65
|
+
end
|
58
66
|
end
|
59
67
|
|
60
68
|
def self.parse(client, response)
|