add rate setting
This commit is contained in:
parent
6b84921f59
commit
f0df2fac26
|
@ -33,12 +33,13 @@ class Admin::PlowController < OrbitAdminController
|
|||
host = uri.host
|
||||
ip = @setting.ip
|
||||
concurrent = @setting.concurrent
|
||||
rate = @setting.rate
|
||||
scheme = uri.scheme
|
||||
Thread.new do
|
||||
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
|
||||
`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
|
||||
max_wait = 10
|
||||
|
|
|
@ -5,4 +5,5 @@ class PlowSetting
|
|||
field :concurrent, type: Integer, :default => 1
|
||||
field :ip, type: String
|
||||
field :url, type: String
|
||||
field :rate, type: Integer, :default => 5000
|
||||
end
|
|
@ -25,6 +25,13 @@
|
|||
</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? %>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Summary</label>
|
||||
|
|
Loading…
Reference in New Issue