scout 1.1.6 → 1.1.7

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.
Files changed (5) hide show
  1. data/CHANGELOG +2 -1
  2. data/bin/scout +2 -10
  3. data/lib/scout.rb +1 -1
  4. data/lib/scout/server.rb +7 -1
  5. metadata +3 -3
data/CHANGELOG CHANGED
@@ -1,6 +1,7 @@
1
1
  == 1.1.6
2
2
 
3
- * minor documentation update in scout installation wizard
3
+ * Introducing a delta for the plugin run interval, now allowing runs even if
4
+ they are up to 30 seconds early
4
5
 
5
6
  == 1.1.5
6
7
 
data/bin/scout CHANGED
@@ -139,19 +139,11 @@ if [:client_key, :plugin].all? { |o| options[o].nil? } and
139
139
  puts <<-END_SUCCESS.gsub(/^ {4}/, "")
140
140
 
141
141
  Success!
142
-
143
- Now, you must setup Scout to run on a scheduled basis.
144
142
 
145
- If you are using the system crontab (usually located at /etc/crontab):
143
+ ******* NOW, INSTALL IN CRONTAB *******
146
144
 
147
- ****** START CRONTAB SAMPLE ******
148
- */30 * * * * #{USER} #{File.expand_path($PROGRAM_NAME)} #{options[:client_key]}
149
- ******* END CRONTAB SAMPLE *******
145
+ */10 * * * * #{USER} #{File.expand_path($PROGRAM_NAME)} #{options[:client_key]}
150
146
 
151
- If you are using this current user's crontab (using crontab -e to edit):
152
-
153
- ****** START CRONTAB SAMPLE ******
154
- */30 * * * * #{File.expand_path($PROGRAM_NAME)} #{options[:client_key]}
155
147
  ******* END CRONTAB SAMPLE *******
156
148
 
157
149
  For help setting up Scout with crontab, please visit:
@@ -4,5 +4,5 @@ require "scout/plugin"
4
4
  require "scout/server"
5
5
 
6
6
  module Scout
7
- VERSION = "1.1.6".freeze
7
+ VERSION = "1.1.7".freeze
8
8
  end
@@ -21,6 +21,11 @@ module Scout
21
21
  # otherwise, a timeout error is generated.
22
22
  #
23
23
  PLUGIN_TIMEOUT = 60
24
+ #
25
+ # A fuzzy range of seconds in which it is okay to rerun a plugin.
26
+ # We consider the interval close enough at this point.
27
+ #
28
+ RUN_DELTA = 30
24
29
 
25
30
  # Creates a new Scout Server connection.
26
31
  def initialize(server, client_key, history_file, logger = nil)
@@ -82,7 +87,8 @@ module Scout
82
87
  last_run = @history["last_runs"][plugin[:name]]
83
88
  memory = @history["memory"][plugin[:name]]
84
89
  run_time = Time.now
85
- if last_run.nil? or run_time >= last_run + plugin[:interval]
90
+ delta = last_run.nil? ? nil : run_time - (last_run + plugin[:interval])
91
+ if last_run.nil? or delta.between?(-RUN_DELTA, 0) or delta >= 0
86
92
  debug "Plugin is past interval and needs to be run. " +
87
93
  "(last run: #{last_run || 'nil'})"
88
94
  debug "Compiling plugin..."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Highgroove Studios
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-04 00:00:00 -04:00
12
+ date: 2008-04-28 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  requirements: []
75
75
 
76
76
  rubyforge_project: scout
77
- rubygems_version: 1.0.1
77
+ rubygems_version: 1.1.1
78
78
  signing_key:
79
79
  specification_version: 2
80
80
  summary: Scout makes monitoring and reporting on your web applications as flexible and simple as possible.