Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

feature: allow to pass-through PhantomJS Options

use -l 'debug' -l 'proxy=localhost'

Signed-off-by: Jonas Genannt <jonas@brachium-system.net>
  • Loading branch information...
commit 99a49f3d5b9c90d1b5cbfcbf87f4ef44292e71fe 1 parent a72e4df
@hggh authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 check_http_load_time.rb
View
5 check_http_load_time.rb
@@ -9,6 +9,7 @@
options = {}
options[:phantomjs_bin] = "/usr/bin/phantomjs"
options[:phantomjs_opts] = "--load-images=yes --local-to-remote-url-access=yes --disk-cache=no --ignore-ssl-errors=yes"
+options[:phantomjs_extra_ops] = [ ]
options[:snifferjs] = File.join(File.dirname(__FILE__), "netsniff.js")
options[:warning] = 1.0
options[:critical] = 2.0
@@ -40,6 +41,9 @@
opts.on("-d", "--debug", "Enable debug output") do
options[:debug] = true
end
+ opts.on("-l", "--ps-extra-opts [STRING]", "Extra PhantomJS Options (default: no options) [eg -l 'debug' -l 'proxy=localhost']") do |l|
+ options[:phantomjs_extra_ops] << "--" + l.to_s
+ end
opts.on("-r", "--request [RANGE]", "Check if requests is in range [50:100] (default: not checked)") do |r|
begin
if r =~ /^(\d+):(\d+)$/ and $1.to_i < $2.to_i
@@ -69,6 +73,7 @@
cmd = Array.new
cmd << options[:phantomjs_bin]
cmd << options[:phantomjs_opts]
+ cmd << options[:phantomjs_extra_ops]
cmd << options[:snifferjs]
cmd << website_url.to_s
cmd << "2> /dev/null"
Please sign in to comment.
Something went wrong with that request. Please try again.