stethoscope 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -32,10 +32,16 @@ Default: `/heartbeat`
32
32
 
33
33
  Stethoscope uses _checks_ to check some component of the application. A check is simply a block that is executed when the heartbeat url is hit.
34
34
 
35
+ You don't need any checks. If you don't include one, Stethoscope will respond if the application is running.
36
+
37
+ If you do want to check some other pieces of your stack, checks is where it's at.
38
+
35
39
  A response hash is made available to store any information which is then made available to the heartbeat template.
36
40
 
37
41
  Returning a response _:status_ outside 200..299 will trigger Stethoscope to return a 500 status code to the client.
38
42
 
43
+
44
+
39
45
  #### Example
40
46
 
41
47
  Stethoscope.check :database do |response|
@@ -2,6 +2,8 @@ require 'stethoscope'
2
2
 
3
3
  # Provides a check for active record databases
4
4
  Stethoscope.check :database do |response|
5
- ActiveRecord::Base.connection.execute("SELECT 1")
5
+ query = "SELECT 1"
6
+ response["query"] = query.inspect
7
+ ActiveRecord::Base.connection.execute(query)
6
8
  response["ActiveRecord"] = "OK"
7
9
  end
@@ -2,7 +2,9 @@ require 'stethoscope'
2
2
 
3
3
  # Provides a check for datamapper databases
4
4
  Stethoscope.check :database do |response|
5
- DataMapper.repository.adapter.execute("select 1")
5
+ query = "SELECT 1"
6
+ response["query"] = query.inspect
7
+ DataMapper.repository.adapter.execute(query)
6
8
  response['Datamapper'] = "OK"
7
9
  end
8
10
 
@@ -1,3 +1,3 @@
1
1
  class Stethoscope
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stethoscope
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Neighman