bloopletech-webstats 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 7
3
+ :minor: 8
4
4
  :patch: 0
@@ -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 = -1
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] * 1000
22
- raise Exception unless http.get(uri.path).code.include?(200, 201, 202, 203, 204, 205, 206, 301, 302, 304)
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 => 5000, :danger_response_time_threshold => 15000, :urls => ['http://localhost/'] }
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{webstats}
5
- s.version = "0.7.0"
5
+ s.version = "0.8.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Brenton Fletcher"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloopletech-webstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brenton Fletcher