No description, website, or topics provided.
Ruby
Latest commit 5f515a8 Nov 27, 2015 @SpringMT Merge pull request #2 from niku4i/typo
Fix typo in REAMDE
Permalink
Failed to load latest commit information.
examples Update README May 23, 2015
lib/rack Bump version May 21, 2015
spec Add rack-server_status May 17, 2015
.consolerc Initial commit May 17, 2015
.gitignore Bugfix May 21, 2015
.rspec Initial commit May 17, 2015
.travis.yml Add rack-server_status May 17, 2015
Gemfile Add rack-server_status May 17, 2015
LICENSE.txt Modify LICENSE May 17, 2015
README.md Fix typo in REAMDE Nov 27, 2015
Rakefile Initial commit May 17, 2015
rack-server_status.gemspec Add examples May 20, 2015

README.md

Rack::ServerStatus Build Status

This is a Ruby version of kazeburo/Plack-Middleware-ServerStatus-Lite.

Installation

Add this line to your application's Gemfile:

gem 'rack-server_status'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-server_status

Usage

Getting started

Tell your app to use the Rack::ServerStatus middleware.

For Rails 3+ apps

# In config/application.rb
config.middleware.use Rack::ServerStatus, scoreboard_path: './tmp'

Rackup files

# In config.ru
use Rack::ServerStatus, scoreboard_path: './tmp'

Get Status

% curl http://server:port/server-status
Uptime: 1432227723 (12 seconds)
BusyWorkers: 1
IdleWorkers: 3
--
pid status remote_addr host method uri protocol ss
55091 _  -    0
55092 _  -    1
55093 A 127.0.0.1 localhost:3000 GET /server-status HTTP/1.1 0
55094 _  -    0

# JSON format
% curl http://server:port/server-status?json
{"Uptime":1432388968,"BusyWorkers":1,"IdleWorkers":3,"stats":[{"remote_addr":null,"host":"-","method":null,"uri":null,"protocol":null,"pid":87240,"status":"_","ss":2},{"remote_addr":"127.0.0.1","host":"localhost:3000","method":"GET","uri":"/server-status?json","protocol":"HTTP/1.1","pid":87241,"status":"A","ss":0},{"remote_addr":null,"host":"-","method":null,"uri":null,"protocol":null,"pid":87242,"status":"_","ss":3},{"remote_addr":null,"host":"-","method":null,"uri":null,"protocol":null,"pid":87243,"status":"_","ss":3}]}

Configuration

name detail example default
path location that displays server status path: '/server-status' /server-status
allow host based access control of a page of server status. allow: ['127.0.0.1'] []
scoreboard scoreboard directory scoreboard_path: './tmp' nil
skip_ps_command skip_ps_command: true false

Contributing

  1. Fork it ( https://github.com/[my-github-username]/rack-server_status/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request