add rate setting
This commit is contained in:
parent
6b84921f59
commit
f0df2fac26
|
@ -33,12 +33,13 @@ class Admin::PlowController < OrbitAdminController
|
||||||
host = uri.host
|
host = uri.host
|
||||||
ip = @setting.ip
|
ip = @setting.ip
|
||||||
concurrent = @setting.concurrent
|
concurrent = @setting.concurrent
|
||||||
|
rate = @setting.rate
|
||||||
scheme = uri.scheme
|
scheme = uri.scheme
|
||||||
Thread.new do
|
Thread.new do
|
||||||
if !ip.blank?
|
if !ip.blank?
|
||||||
`ulimit -n 100000 && #{Binary} #{scheme}://#{ip}#{uri.request_uri} --host=#{host} --listen=#{SocketFile} -c#{concurrent} --summary > #{LogFile}`
|
`ulimit -n 100000 && #{Binary} #{scheme}://#{ip}#{uri.request_uri} --host=#{host} --listen=#{SocketFile} -c#{concurrent} --rate #{rate} --summary > #{LogFile}`
|
||||||
else
|
else
|
||||||
`ulimit -n 100000 && #{Binary} #{@setting.url} --listen=#{SocketFile} -c#{concurrent} --summary > #{LogFile}`
|
`ulimit -n 100000 && #{Binary} #{@setting.url} --listen=#{SocketFile} -c#{concurrent} --rate #{rate} --summary > #{LogFile}`
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
max_wait = 10
|
max_wait = 10
|
||||||
|
|
|
@ -5,4 +5,5 @@ class PlowSetting
|
||||||
field :concurrent, type: Integer, :default => 1
|
field :concurrent, type: Integer, :default => 1
|
||||||
field :ip, type: String
|
field :ip, type: String
|
||||||
field :url, type: String
|
field :url, type: String
|
||||||
|
field :rate, type: Integer, :default => 5000
|
||||||
end
|
end
|
|
@ -25,6 +25,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted" for="rate">Request Rate(Requests/seconds)</label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.number_field :rate, :class => 'input-large' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% if !@logContent.blank? %>
|
<% if !@logContent.blank? %>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted">Summary</label>
|
<label class="control-label muted">Summary</label>
|
||||||
|
|
Loading…
Reference in New Issue