rack-server_status 0.0.1 → 0.0.2

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: 209c13022051ab963d2d09b2f8d4a3ab0fed32cc
4
- data.tar.gz: f4a25b58e4fbc5ca1ac07cef73db09a1c8eebf8d
3
+ metadata.gz: caa82f8072806ea781d249afc13d797d1c190cf5
4
+ data.tar.gz: 4325c47c0a318d934638bad864f87522a8b359b7
5
5
  SHA512:
6
- metadata.gz: fd93772d4765b43c4a8e8ca023e24655e82d020b62044301dd4ff73779585a3ae212aa56388515eae03b8571b42f9159cb28b92ad29ef5eb4563dd51f52930ad
7
- data.tar.gz: 68230a7f8a284f521f0e7a1abf0bbc65328b3ad818e58d02bd6faea5209b350966db6f03a580248fe0efc211495c8949da2cf7f0042a5d19671fa08eb1691d4c
6
+ metadata.gz: 00ec1c5c1da7d646bc564a738de8e8221b5e9eb273d561c14913fb86d764509975394374672ce4b5883316bc82476035d655316c9652a940764b173e167f7aa5
7
+ data.tar.gz: 536a54465b8b6f09cfca95f138f2ddf7e7571662a23285896717da3e2d9957b4263aa187cc6ce31a5cd572ebe43bfa3ff221c97e4ae326641d9c505f39b91b8d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rack::ServerStatus [![Build Status](https://travis-ci.org/SpringMT/rack-server_status.svg?branch=master)](https://travis-ci.org/SpringMT/rack-server_status)
2
2
 
3
- TODO: Write a gem description
3
+ This is a Ruby version of [kazeburo/Plack-Middleware-ServerStatus-Lite](https://github.com/kazeburo/Plack-Middleware-ServerStatus-Lite).
4
4
 
5
5
  ## Installation
6
6
 
data/examples/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gem 'unicorn'
3
+ gem 'worker_scoreboard'
4
+ gem 'parallel'
@@ -0,0 +1,20 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ kgio (2.9.3)
5
+ parallel (1.3.3)
6
+ rack (1.6.1)
7
+ raindrops (0.13.0)
8
+ unicorn (4.9.0)
9
+ kgio (~> 2.6)
10
+ rack
11
+ raindrops (~> 0.7)
12
+ worker_scoreboard (0.0.2)
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ parallel
19
+ unicorn
20
+ worker_scoreboard
@@ -0,0 +1,16 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib/')
2
+ require 'rack/server_status'
3
+
4
+ use Rack::ServerStatus, scoreboard_path: './tmp'
5
+
6
+ class HelloWorldApp
7
+ def call(env)
8
+ sleep 10
9
+ [ 200, { 'Content-Type' => 'text/plain' }, ['Hello World!'] ]
10
+ end
11
+ end
12
+
13
+ map "/foo" do
14
+ run HelloWorldApp.new
15
+ end
16
+
@@ -0,0 +1,13 @@
1
+ require 'parallel'
2
+ require 'net/http'
3
+ $proc_num = 5
4
+ $execute_num = 10
5
+
6
+ Parallel.map([1,2,3,4,5,6], :in_processes => $proc_num) do |letter|
7
+ $execute_num.times do
8
+ http = Net::HTTP.new('localhost', 3000)
9
+ req = Net::HTTP::Get.new('/foo')
10
+ http.request(req)
11
+ end
12
+ end
13
+
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ worker_processes 4
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class ServerStatus
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -24,10 +24,13 @@ module Rack
24
24
 
25
25
  if @path && env['PATH_INFO'] == @path
26
26
  res = handle_server_status(env)
27
+ set_state!('_')
27
28
  return res
28
29
  end
29
30
 
30
- @app.call(env)
31
+ res = @app.call(env)
32
+ set_state!('_')
33
+ return res
31
34
  end
32
35
 
33
36
  private
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.files = `git ls-files -z`.split("\x0")
21
21
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features|examples)/})
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_dependency "worker_scoreboard"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-server_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-17 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: worker_scoreboard
@@ -81,6 +81,15 @@ files:
81
81
  - LICENSE.txt
82
82
  - README.md
83
83
  - Rakefile
84
+ - examples/Gemfile
85
+ - examples/Gemfile.lock
86
+ - examples/config.ru
87
+ - examples/paralell_test.rb
88
+ - examples/tmp/status_42641
89
+ - examples/tmp/status_42642
90
+ - examples/tmp/status_42643
91
+ - examples/tmp/status_42644
92
+ - examples/unicorn.rb
84
93
  - lib/rack/server_status.rb
85
94
  - lib/rack/server_status/version.rb
86
95
  - rack-server_status.gemspec
@@ -111,6 +120,15 @@ signing_key:
111
120
  specification_version: 4
112
121
  summary: Show server status
113
122
  test_files:
123
+ - examples/Gemfile
124
+ - examples/Gemfile.lock
125
+ - examples/config.ru
126
+ - examples/paralell_test.rb
127
+ - examples/tmp/status_42641
128
+ - examples/tmp/status_42642
129
+ - examples/tmp/status_42643
130
+ - examples/tmp/status_42644
131
+ - examples/unicorn.rb
114
132
  - spec/server_status_spec.rb
115
133
  - spec/spec_helper.rb
116
134
  has_rdoc: