okcomputer 1.6.6 → 1.7.0

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: cc4685c3596a7eab3f1fc989e48f14a68c24d309
4
- data.tar.gz: 394fdeca284f5261ef5ad5c9e2ca803e8c01cd11
3
+ metadata.gz: eb0679c9b6364591f99fe66df0aae3976c423e6c
4
+ data.tar.gz: 5ace0ae36c733a321144cc3d6c4b59a9ce76ce72
5
5
  SHA512:
6
- metadata.gz: 48acc3a73c5ca97e56d5c9a34c88ece034713664527fa00acdf8eb8df252d988e5f8d415f6be5e1d1e39fbb638fe36e3aa5b4f44338fabc426ec1da452c1f277
7
- data.tar.gz: 5ef623bad1e7a2cc2d1f3841fcf7304bf3594daa660c423b2f398917fff7b0a44c3f793e57118f360686e39bda91066a2ff89308f4486bfccf0927a0fb222c98
6
+ metadata.gz: c5d670dfbecd8bce26f4a3d5689e45edb6c326bf3c7322b80131d67ce023f93b212fee219ded1482e790dc724e5a42fd0fbf7618eba8fea251275230bc2147c9
7
+ data.tar.gz: a6a3ab0895dda2a6decbee0f7559a20114df7503a81af5597a2773484c777b3f59f3c1825f1a81c0f196db66f8bb932e5d3b8b43495d4872072f9e62f2a9ac13
data/README.markdown CHANGED
@@ -15,6 +15,13 @@ OK Computer][blog].
15
15
 
16
16
  [blog]:http://pulse.sportngin.com/news_article/show/267646?referrer_id=543230
17
17
 
18
+ #### Not using Rails?
19
+
20
+ If you use [Grape] instead of Rails, check out [okcomputer-grape].
21
+
22
+ [Grape]:https://github.com/ruby-grape/grape
23
+ [okcomputer-grape]:https://github.com/bellycard/okcomputer-grape
24
+
18
25
  ## Installation
19
26
 
20
27
  Add this line to your application's Gemfile:
@@ -0,0 +1,29 @@
1
+ module OkComputer
2
+ class RabbitmqCheck < Check
3
+ attr_reader :url
4
+
5
+ def initialize(url = nil)
6
+ @url = url || ENV['CLOUDAMQP_URL'] || ENV['AMQP_HOST']
7
+ end
8
+
9
+ def check
10
+ mark_message "Connected Successfully"
11
+ mark_message "Rabbit Connection Status: (#{connection_status})"
12
+ rescue => e
13
+ mark_failure
14
+ mark_message "Error: '#{e}'"
15
+ end
16
+
17
+ def connection_status
18
+ connection = Bunny.new(@url)
19
+ connection.start
20
+ status = connection.status
21
+ connection.close
22
+ status
23
+ rescue => e
24
+ raise ConnectionFailed, e
25
+ end
26
+
27
+ ConnectionFailed = Class.new(StandardError)
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = '1.6.6'
2
+ VERSION = '1.7.0'
3
3
  end
data/lib/okcomputer.rb CHANGED
@@ -17,6 +17,7 @@ require "ok_computer/built_in_checks/generic_cache_check"
17
17
  require "ok_computer/built_in_checks/elasticsearch_check"
18
18
  require "ok_computer/built_in_checks/mongoid_check"
19
19
  require "ok_computer/built_in_checks/mongoid_replica_set_check"
20
+ require "ok_computer/built_in_checks/rabbitmq_check"
20
21
  require "ok_computer/built_in_checks/redis_check"
21
22
  require "ok_computer/built_in_checks/resque_backed_up_check"
22
23
  require "ok_computer/built_in_checks/resque_down_check"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okcomputer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -77,6 +77,7 @@ files:
77
77
  - lib/ok_computer/built_in_checks/http_check.rb
78
78
  - lib/ok_computer/built_in_checks/mongoid_check.rb
79
79
  - lib/ok_computer/built_in_checks/mongoid_replica_set_check.rb
80
+ - lib/ok_computer/built_in_checks/rabbitmq_check.rb
80
81
  - lib/ok_computer/built_in_checks/redis_check.rb
81
82
  - lib/ok_computer/built_in_checks/resque_backed_up_check.rb
82
83
  - lib/ok_computer/built_in_checks/resque_down_check.rb