CheckHTTP
A simple sensor for gather curl stats against an HTTP endpoint.
Installation
Add this line to your application's Gemfile:
gem 'check_http'
And then execute:
$ bundle
Or install it yourself as:
$ gem install check_http
Usage
Via the command line:
$ check_http http://www.github.com
# return_code=ok total_time=0.209625 connect_time=0.111266 namelookup_time=0.028197 effective_url=http://www.github.com primary_ip=207.97.227.243 response_code=301 redirect_count=0 url=http://www.github.com
You can also stream urls into it:
$ cat list_of_urls.txt | check_http
There is also support for an advanced input mode:
$ echo url=http://google.com location=my_house | check_http
# results will include the location key and any other keys you place in the input stream
Via the lib:
require 'check_http'
CheckHTTP.check('http://github.com')
# => {:return_code=>:ok, :total_time=>0.143415, :connect_time=>0.080599, :namelookup_time=>0.023286, :effective_url=>"http://github.com", :primary_ip=>"207.97.227.239", :response_code=>301, :redirect_count=>0, :url=>"http://github.com"}
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request