Skip to content

Commit

Permalink
Rename gem name to status-page.
Browse files Browse the repository at this point in the history
Fix for Rails 5;
Fix Sidekiq
  • Loading branch information
huacnlee committed Apr 6, 2016
1 parent 87303df commit 093cdd2
Show file tree
Hide file tree
Showing 36 changed files with 388 additions and 182 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Gemfile.lock
pkg
tmp
coverage
Expand Down
15 changes: 14 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'rdoc'

# Specify your gem's dependencies in rediska.gemspec
gemspec

gem 'rails', '5.0.0.beta3'
gem 'sqlite3'
gem 'rspec-rails'
gem 'database_cleaner'
gem 'spork'
gem 'pry'
gem 'coveralls'
gem 'rubocop'
gem 'timecop'
gem 'rediska'
gem 'sidekiq'
gem 'resque'
213 changes: 213 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
PATH
remote: .
specs:
status-page (0.0.1)
rails (>= 3.2)

GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (5.0.0.beta3)
actionview (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
rack (~> 2.x)
rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
globalid (>= 0.3.6)
activemodel (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
activerecord (5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
arel (~> 7.0)
activesupport (5.0.0.beta3)
concurrent-ruby (~> 1.0)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.0.0)
ast (2.2.0)
builder (3.2.2)
coderay (1.1.1)
concurrent-ruby (1.0.1)
connection_pool (2.2.0)
coveralls (0.8.13)
json (~> 1.8)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
database_cleaner (1.5.1)
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
globalid (0.3.6)
activesupport (>= 4.1.0)
i18n (0.7.0)
json (1.8.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221)
mini_portile2 (2.0.0)
minitest (5.8.4)
mono_logger (1.1.0)
multi_json (1.11.2)
nio4r (1.2.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
parser (2.3.0.7)
ast (~> 2.2)
powerpack (0.1.1)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (2.0.0.alpha)
json
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0.beta3)
actioncable (= 5.0.0.beta3)
actionmailer (= 5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activerecord (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0.beta3)
sprockets-rails (>= 2.0.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
rake (11.1.2)
rdoc (4.2.2)
json (~> 1.4)
redis (3.2.2)
redis-namespace (1.5.2)
redis (~> 3.0, >= 3.0.4)
rediska (0.5.0)
redis (>= 3)
resque (1.26.0)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.3)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rubocop (0.39.0)
parser (>= 2.3.0.7, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.7.5)
sidekiq (4.1.1)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.0)
rack (>= 1.0)
slop (3.6.0)
spork (0.9.2)
sprockets (3.5.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
timecop (0.8.1)
tins (1.6.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unicode-display_width (1.0.3)
vegas (0.1.11)
rack (>= 1.0.0)
websocket-driver (0.6.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)

PLATFORMS
ruby

DEPENDENCIES
coveralls
database_cleaner
pry
rails (= 5.0.0.beta3)
rdoc
rediska
resque
rspec-rails
rubocop
sidekiq
spork
sqlite3
status-page!
timecop

BUNDLED WITH
1.11.2
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# health-monitor-rails
# status-page

[![Gem Version](https://badge.fury.io/rb/health-monitor-rails.png)](http://badge.fury.io/rb/health-monitor-rails)
[![Build Status](https://travis-ci.org/lbeder/health-monitor-rails.png)](https://travis-ci.org/lbeder/health-monitor-rails)
[![Dependency Status](https://gemnasium.com/lbeder/health-monitor-rails.png)](https://gemnasium.com/lbeder/health-monitor-rails)
[![Coverage Status](https://coveralls.io/repos/lbeder/health-monitor-rails/badge.png)](https://coveralls.io/r/lbeder/health-monitor-rails)
[![Gem Version](https://badge.fury.io/rb/status-page.png)](http://badge.fury.io/rb/status-page)
[![Build Status](https://travis-ci.org/rails-engine/status-page.png)](https://travis-ci.org/rails-engine/status-page)
[![Dependency Status](https://gemnasium.com/rails-engine/status-page.png)](https://gemnasium.com/rails-engine/status-page)
[![Coverage Status](https://coveralls.io/repos/rails-engine/status-page/badge.png)](https://coveralls.io/r/rails-engine/status-page)

This is a health monitoring Rails mountable plug-in, which checks various services (db, cache, sidekiq, redis, etc.).

Mounting this gem will add a '/check' route to your application, which can be used for health monitoring the application and its various services. The method will return an appropriate HTTP status as well as a JSON array representing the state of each provider.

## Setup

If you are using bundler add health-monitor-rails to your Gemfile:
If you are using bundler add status-page to your Gemfile:

```ruby
gem 'health-monitor-rails'
gem 'status-page'
```

Then run:
Expand All @@ -26,14 +26,14 @@ $ bundle install
Otherwise install the gem:

```bash
$ gem install health-monitor-rails
$ gem install status-page
```

## Usage
You can mount this inside your app routes by adding this to config/routes.rb:

```ruby
mount HealthMonitor::Engine, at: '/'
mount StatusPage::Engine, at: '/'
```

## Supported service providers
Expand All @@ -50,7 +50,7 @@ The following services are currently supported:
By default, only the database check is enabled. You can add more service providers by explicitly enabling them via an initializer:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.cache
config.redis
config.sidekiq
Expand All @@ -62,7 +62,7 @@ end
Some of the providers can also accept additional configuration:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.sidekiq.configure do |sidekiq_config|
sidekiq_config.latency = 3.hours
end
Expand All @@ -80,10 +80,10 @@ It's also possible to add custom health check providers suited for your needs (o

In order to add a custom provider, you'd need to:

* Implement the `HealthMonitor::Providers::Base` class and its `check!` method (a check is considered as failed if it raises an exception):
* Implement the `StatusPage::Providers::Base` class and its `check!` method (a check is considered as failed if it raises an exception):

```ruby
class CustomProvider < HealthMonitor::Providers::Base
class CustomProvider < StatusPage::Providers::Base
def check!
raise 'Oh oh!'
end
Expand All @@ -92,7 +92,7 @@ end
* Add its class to the configuration:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.add_custom_provider(CustomProvider)
end
```
Expand All @@ -101,7 +101,7 @@ end
If you need to perform any additional error handling (for example, for additional error reporting), you can configure a custom error callback:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.error_callback = proc do |e|
logger.error "Health check failed with: #{e.message}"

Expand All @@ -114,7 +114,7 @@ end
By default, the `/check` endpoint is not authenticated and is available to any user. You can authenticate using HTTP Basic Auth by providing authentication credentials:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.basic_auth_credentials = {
username: 'SECRET_NAME',
password: 'Shhhhh!!!'
Expand All @@ -126,7 +126,7 @@ end
By default, environmet variables is nil, you need to provide a Hash with your custom environmet variables:

```ruby
HealthMonitor.configure do |config|
StatusPage.configure do |config|
config.environmet_variables = {
build_number: 'BUILD_NUMBER',
git_sha: 'GIT_SHA'
Expand Down
Empty file modified Rakefile
100644 → 100755
Empty file.
44 changes: 0 additions & 44 deletions app/controllers/health_monitor/health_controller.rb

This file was deleted.

Loading

0 comments on commit 093cdd2

Please sign in to comment.