bloopletech-webstats 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/server/data_providers/url_monitor.rb +5 -5
- data/webstats.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -12,14 +12,14 @@ class DataProviders::UrlMonitor
|
|
12
12
|
while(true)
|
13
13
|
@settings[:urls].sort.each do |url|
|
14
14
|
@mutex.synchronize { @readings[url] = { :response_time => -1, :works => (@readings.key?(url) && @readings[url][:works] == :failed ? :failed : :waiting) } }
|
15
|
-
duration =
|
15
|
+
duration = 0
|
16
16
|
works = :failed
|
17
17
|
begin
|
18
18
|
uri = URI.parse(url)
|
19
19
|
start = Time.now
|
20
|
-
Net::HTTP.start(uri.host) { |http|
|
21
|
-
http.read_timeout = http.open_timeout = @settings[:danger_response_time_threshold]
|
22
|
-
raise Exception unless
|
20
|
+
Net::HTTP.start(uri.host, uri.port) { |http|
|
21
|
+
http.read_timeout = http.open_timeout = @settings[:danger_response_time_threshold]
|
22
|
+
raise Exception unless [200, 201, 202, 203, 204, 205, 206, 301, 302, 304].include? http.get(uri.path).code.to_i
|
23
23
|
}
|
24
24
|
|
25
25
|
duration = Time.now - start
|
@@ -59,7 +59,7 @@ sc.innerHTML = temp;
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.default_settings
|
62
|
-
{ :update_rate => 30, :warning_response_time_threshold =>
|
62
|
+
{ :update_rate => 30, :warning_response_time_threshold => 5, :danger_response_time_threshold => 15, :urls => ['http://localhost/'] }
|
63
63
|
end
|
64
64
|
|
65
65
|
def information
|
data/webstats.gemspec
CHANGED