File tree 5 files changed +18
-18
lines changed
spec/integration/middleware
5 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 60
60
http_parser.rb (~> 0.5.3 )
61
61
multi_json (~> 1.0 )
62
62
powerpack (0.0.8 )
63
- proc-wait3 (1.6.0 )
64
63
rack (1.5.2 )
65
64
rack-protection (1.5.0 )
66
65
rack
84
83
powerpack (~> 0.0.6 )
85
84
rainbow (>= 1.1.4 )
86
85
rubyzip (0.9.9 )
86
+ rusage (0.2.0 )
87
87
selenium-webdriver (2.35.1 )
88
88
childprocess (>= 0.2.5 )
89
89
multi_json (~> 1.0 )
@@ -124,12 +124,12 @@ DEPENDENCIES
124
124
launchy (~> 2.1.0 )
125
125
metriks (~> 0.9 )
126
126
poltergeist (~> 1.0.0 )
127
- proc-wait3 (~> 1.6 )
128
127
qless !
129
128
rake (~> 10.0 )
130
129
rspec (~> 2.12 )
131
130
rspec-fire (~> 1.1 )
132
131
rubocop (~> 0.13.1 )
132
+ rusage (~> 0.2.0 )
133
133
sentry-raven (~> 0.4 )
134
134
simplecov (~> 0.7.1 )
135
135
sinatra (~> 1.3.2 )
Original file line number Diff line number Diff line change 7
7
n . times { Integer ( `ps -o rss= -p #{ Process . pid } ` ) * 1024 }
8
8
end
9
9
10
- x . report ( "proc-wait3 " ) do
11
- require 'proc/wait3 '
12
- n . times { Process . getrusage }
10
+ x . report ( "rusage " ) do
11
+ require 'rusage '
12
+ n . times { Process . rusage }
13
13
end
14
14
end
15
15
16
16
=begin
17
17
On my computer:
18
18
19
19
Rehearsal ------------------------------------------------
20
- shelling out 0.100000 0.670000 3.750000 ( 4.141153 )
21
- proc-wait3 0.000000 0.000000 0.000000 ( 0.002601 )
22
- --------------------------------------- total: 3.750000sec
20
+ shelling out 0.090000 0.550000 3.650000 ( 4.051986 )
21
+ rusage 0.010000 0.000000 0.010000 ( 0.002501 )
22
+ --------------------------------------- total: 3.660000sec
23
23
24
24
user system total real
25
- shelling out 0.090000 0.730000 3.760000 ( 4.150078 )
26
- proc-wait3 0.000000 0.000000 0.000000 ( 0.003116 )
25
+ shelling out 0.100000 0.550000 3.660000 ( 4.031830 )
26
+ rusage 0.010000 0.000000 0.010000 ( 0.001669 )
27
27
=end
28
28
Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ def format_large_number(num)
28
28
end
29
29
30
30
begin
31
- require 'proc/wait3 '
31
+ require 'rusage '
32
32
def self . current_usage
33
- Process . getrusage . maxrss
33
+ Process . rusage . maxrss
34
34
end
35
35
rescue LoadError
36
- warn "Could not load `proc-wait3 ` gem. Falling back to shelling out to get process memory usage, " +
36
+ warn "Could not load `rusage ` gem. Falling back to shelling out to get process memory usage, " +
37
37
"which is several orders of magnitude slower."
38
38
39
39
def self . current_usage
Original file line number Diff line number Diff line change @@ -50,5 +50,5 @@ language-specific extension will also remain up to date.
50
50
s . add_development_dependency 'sentry-raven' , '~> 0.4'
51
51
s . add_development_dependency 'metriks' , '~> 0.9'
52
52
s . add_development_dependency 'rubocop' , '~> 0.13.1'
53
- s . add_development_dependency 'proc-wait3 ' , '~> 1.6 '
53
+ s . add_development_dependency 'rusage ' , '~> 0.2.0 '
54
54
end
Original file line number Diff line number Diff line change @@ -92,19 +92,19 @@ def self.puts(msg)
92
92
end
93
93
end
94
94
95
- context "when the proc-wait3 gem is available" do
95
+ context "when the rusage gem is available" do
96
96
before do
97
97
load "qless/middleware/memory_usage_monitor.rb"
98
98
99
- unless Process . respond_to? ( :getrusage )
100
- pending "Could not load the proc-wait3 gem"
99
+ unless Process . respond_to? ( :rusage )
100
+ pending "Could not load the rusage gem"
101
101
end
102
102
end
103
103
104
104
include_examples "memory usage monitor"
105
105
end
106
106
107
- context "when the proc-wait3 gem is not available" do
107
+ context "when the rusage gem is not available" do
108
108
before do
109
109
MemoryUsageMonitor . stub ( :warn )
110
110
MemoryUsageMonitor . stub ( :require ) . and_raise ( LoadError )
You can’t perform that action at this time.
0 commit comments