komachi_heartbeat 2.1.8 → 2.1.9

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: 7e6926b64acf4200e060e38b315b0c563e349467
4
- data.tar.gz: 48f41e8af45cf06c642885b5ed6c6a4f3cd8b836
3
+ metadata.gz: 34ab641fd5eb2fbbfb21f3e6ed116dac2cedc66b
4
+ data.tar.gz: 31ead797704d2f5e7a3ebcafcda47d302b332320
5
5
  SHA512:
6
- metadata.gz: efa055a8238abd512d26c4743a7daf7a3d863cfd3ccc7448ef7f08cad40cebfe19861c4a9ba02198540dafdb1f9ffa41014005c1f933c54651597035454d6881
7
- data.tar.gz: ca5b4a943a4e87e9900e1233b42e9bdf71999957a32c2f979423cbdbd0a4a877ef23a90a3c7b4e3c574c9f4a12af5c400b3da8762331c9476314f365a4048768
6
+ metadata.gz: 6f0afc69cd7b9d013365e71124f9b194f2f3173f56a465f69e59043c41082b9cf26e07b8739625f1bfb39befca2646d8979c1284f5c3ea2d7959e8483a2aa805
7
+ data.tar.gz: 76007cc572048e489d9e80a28b3c1967697ef5b2144c79985ec3b2a763eccca7fc5fb697d8fb15a3265c2b909710f98d5cd2b85d5f970f516c7c3aea2e729271
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # KomachiHeartbeat
2
+ [![Gem Version](https://badge.fury.io/rb/komachi_heartbeat.svg)](http://badge.fury.io/rb/komachi_heartbeat)
3
+ [![Build Status](https://api.travis-ci.org/mitaku/komachi_heartbeat.svg?branch=master)](https://travis-ci.org/mitaku/komachi_heartbeat)
2
4
 
3
5
  ## About
4
6
  Rails アプリケーションとDBサーバーの死活監視するためのURLを提供するEngine
@@ -22,7 +24,7 @@ Rails アプリケーションとDBサーバーの死活監視するためのURL
22
24
  ### バージョン確認
23
25
  `/MOUNT_PATH/version`
24
26
 
25
- アプリ名・バージョンを取得する
27
+ アプリ名・バージョン・REVISION を取得する
26
28
 
27
29
  ### WorkerのQueue監視
28
30
  `/MOUNT_PATH/stats/worker`
@@ -67,6 +69,9 @@ Rails アプリケーションとDBサーバーの死活監視するためのURL
67
69
  - `worker_stats_enabled`
68
70
  - WorkerのQueueの数をチェックするかどうか
69
71
  - default: false
72
+ - `revision_path`
73
+ - REVISION ファイルの位置
74
+ - default: `-> { Rails.root.join("REVISION") }`
70
75
 
71
76
  ### Example
72
77
 
@@ -18,7 +18,7 @@ module KomachiHeartbeat
18
18
  end
19
19
 
20
20
  def version
21
- obj = {:name => application_name, :version => application_version, :access => DateTime.now}
21
+ obj = {:name => application_name, :version => application_version, :revision => revision, :access => DateTime.now}
22
22
 
23
23
  render json: obj
24
24
  end
@@ -87,5 +87,16 @@ module KomachiHeartbeat
87
87
  def application_version
88
88
  KomachiHeartbeat.config.application_version
89
89
  end
90
+
91
+ def revision
92
+ file = KomachiHeartbeat.config.revision_path
93
+ file = file.call if file.is_a?(Proc)
94
+ file = Pathname.new(file) unless file.is_a?(Pathname)
95
+ if file.exist?
96
+ file.read.chomp
97
+ else
98
+ "UNKNOWN"
99
+ end
100
+ end
90
101
  end
91
102
  end
@@ -1,7 +1,7 @@
1
1
  module KomachiHeartbeat
2
2
  class Config
3
3
  include ActiveSupport::Configurable
4
- config_accessor :application_version, :application_name, :db_check_enabled, :redis_check_enabled, :memcached_check_enabled, :database_class_names, :memcached_server_names, :redis_servers, :worker_stats_enabled
4
+ config_accessor :application_version, :application_name, :db_check_enabled, :redis_check_enabled, :memcached_check_enabled, :database_class_names, :memcached_server_names, :redis_servers, :worker_stats_enabled, :revision_path
5
5
 
6
6
  configure do |config|
7
7
  config.application_name = "Unknown"
@@ -16,6 +16,8 @@ module KomachiHeartbeat
16
16
  config.memcached_server_names = ["localhost"]
17
17
 
18
18
  config.worker_stats_enabled = false
19
+
20
+ config.revision_path = -> { Rails.root.join("REVISION") }
19
21
  end
20
22
  end
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module KomachiHeartbeat
2
- VERSION = "2.1.8"
2
+ VERSION = "2.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: komachi_heartbeat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takumi MIURA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  requirements: []
263
263
  rubyforge_project:
264
- rubygems_version: 2.2.2
264
+ rubygems_version: 2.4.5
265
265
  signing_key:
266
266
  specification_version: 4
267
267
  summary: Rails Application Heartbeat Check Engine.