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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d70d0cac954431647b68c44f1b8adcb23c10ecb
4
- data.tar.gz: 3fd7550588ea4e105678fb79b59f95ff995bacc9
3
+ metadata.gz: 8f2cb727badabd029ece38442681db32552eed77
4
+ data.tar.gz: 25334931bdf4dca7ad1e0fcff36ac6d7008453b1
5
5
  SHA512:
6
- metadata.gz: 83bcf363e995eecbb39b0756fd680bc4d243670a525dfc4b0ed5b48c28dea30e715fcb0bbdca6421b7330bc1a2024cb6ed711bc074aafa1a0468120816e7d74b
7
- data.tar.gz: e493f512d8a44a0888fb79f6680265d6cc5c39b67413df165a9fc23c4f04664ba40a8ba3eadbdb1415dec59efecb73cafd850f95b4e2567cbec95d0c81206363
6
+ metadata.gz: f612d9ba8dbc4704ff971287b4c93b318b9bb37572311cc1135e162dc54c88a80e34fd1ea544c6167bda02810b2ade5754c9725f64e9a7bae0357363a4387e49
7
+ data.tar.gz: eb1559c6ff786315cfcf391ce2d5f30057ebbeab1b3172a38e3da9904220ffd22525c8c4678fa74161603224d2d2c05313213acf26f31ccb3efa6e27413bbfcf
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GraphiteMetricsChecker
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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.3'
8
- spec.authors = ["Raj & Balu"]
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
- result_set.push(result)
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 false
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 true
56
+ return result[0]
50
57
  end
51
58
  end
52
59
  return false
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphite_metrics_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - Raj & Balu
7
+ - Raj, Balu, Michael
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []