graphite_metrics_checker 0.0.3 → 0.0.5
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/graphite_metrics_checker.gemspec +2 -2
- data/lib/graphite_metrics_checker.rb +12 -5
- 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: 8f2cb727badabd029ece38442681db32552eed77
|
4
|
+
data.tar.gz: 25334931bdf4dca7ad1e0fcff36ac6d7008453b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f612d9ba8dbc4704ff971287b4c93b318b9bb37572311cc1135e162dc54c88a80e34fd1ea544c6167bda02810b2ade5754c9725f64e9a7bae0357363a4387e49
|
7
|
+
data.tar.gz: eb1559c6ff786315cfcf391ce2d5f30057ebbeab1b3172a38e3da9904220ffd22525c8c4678fa74161603224d2d2c05313213acf26f31ccb3efa6e27413bbfcf
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GraphiteMetricsChecker
|
2
2
|
|
3
|
-
|
3
|
+
Graphite Metrics Checker to be used for testing whatever graphite produces as metrics
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
Basically you can pass a hash of configs containing end point and the metrics to monitor i,e (count etc) and pass the graphite ip and app ip and the timeframe and it can find out if there was any output
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
@@ -4,8 +4,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "graphite_metrics_checker"
|
7
|
-
spec.version = '0.0.
|
8
|
-
spec.authors = ["Raj
|
7
|
+
spec.version = '0.0.5'
|
8
|
+
spec.authors = ["Raj, Balu, Michael"]
|
9
9
|
spec.email = ["abc.com"]
|
10
10
|
spec.summary = "Graphite Metrics Checker"
|
11
11
|
spec.description = "Graphite Metrics Checker"
|
@@ -13,17 +13,24 @@ class GraphiteMetricsChecker
|
|
13
13
|
|
14
14
|
def get_metrics_for_end_points
|
15
15
|
set_time
|
16
|
-
result_set = []
|
16
|
+
#result_set = []
|
17
17
|
@list_of_api.each_pair do |key,api|
|
18
18
|
endpoint = api['endpoint']
|
19
19
|
metrics = api['metrics']
|
20
20
|
metrics.each_pair do |key,metric|
|
21
21
|
result = get_metrics(endpoint,metric)
|
22
22
|
result =check_result_for_metrics(result)
|
23
|
-
|
23
|
+
|
24
|
+
if result != nil
|
25
|
+
puts "#{endpoint} #{metric} #{result}"
|
26
|
+
else
|
27
|
+
raise "#{endpoint} #{metric} not found"
|
28
|
+
end
|
29
|
+
|
30
|
+
#result_set.push(result)
|
24
31
|
end
|
25
32
|
end
|
26
|
-
return result_set
|
33
|
+
#return result_set
|
27
34
|
end
|
28
35
|
|
29
36
|
|
@@ -41,12 +48,12 @@ class GraphiteMetricsChecker
|
|
41
48
|
result_set = JSON.parse(result)
|
42
49
|
|
43
50
|
if result_set.size == 0
|
44
|
-
return
|
51
|
+
return nil
|
45
52
|
end
|
46
53
|
results = result_set.first['datapoints']
|
47
54
|
results.each do |result|
|
48
55
|
if result[0] != nil
|
49
|
-
return
|
56
|
+
return result[0]
|
50
57
|
end
|
51
58
|
end
|
52
59
|
return false
|
metadata
CHANGED