lib/sensu/server/process.rb
# Determine stale check results, those that have not executed in
# a specified amount of time (check TTL). This method iterates
# through stored check results that have a defined TTL value (in
# seconds). The `create_check_ttl_results()` method is used to
# inspect each check result, calculating their time since last
# check execution (in seconds). If the time since last execution
# is equal to or greater than the check TTL, a warning check
# result is published with the appropriate check output. A
# relatively small check results slice size (20) is used to
# reduce the number of check results inspected within a single
# tick of the EM reactor.
#
# @param interval [Integer] to use for the check TTL result
#   interval.
Determine stale check results, those that have not executed in
a specified amount of time (check TTL). This method iterates
through stored check results that have a defined TTL value (in
seconds). The `create_check_ttl_results()` method is used to
inspect each check result, calculating their time since last
check execution (in seconds). If the time since last execution
is equal to or greater than the check TTL, a warning check
result is published with the appropriate check output. A
relatively small check results slice size (20) is used to
reduce the number of check results inspected within a single
tick of the EM reactor.
Determine stale check results those that have not executed in a specified amount of time ( check TTL ) . This method iterates through stored check results that have a defined TTL value ( in seconds ) . The ` create_check_ttl_results () ` method is used to inspect each check result calculating their time since last check execution ( in seconds ) . If the time since last execution is equal to or greater than the check TTL a warning check result is published with the appropriate check output . A relatively small check results slice size ( 20 ) is used to reduce the number of check results inspected within a single tick of the EM reactor .
def determine_stale_check_results(interval=30)
        @logger.info("determining stale check results (ttl)")
        @redis.smembers("ttl") do |ttl_keys|
          ttl_key_count = ttl_keys.length
          ttl_check_results = Proc.new do |slice_start, slice_size|
            unless slice_start > ttl_key_count - 1
              ttl_keys_slice = ttl_keys.slice(slice_start..slice_size)
              create_check_ttl_results(ttl_keys_slice, interval) do
                ttl_check_results.call(slice_start + 20, slice_size + 20)
              end
            end
          end
          ttl_check_results.call(0, 19)
        end
      end
def determine_stale_check_results ( interval = 30 ) @logger . info ( "determining stale check results (ttl)" ) @redis . smembers ( "ttl" ) do | ttl_keys | ttl_key_count = ttl_keys . length ttl_check_results = Proc . new do | slice_start , slice_size | unless slice_start > ttl_key_count - 1 ttl_keys_slice = ttl_keys . slice ( slice_start .. slice_size ) create_check_ttl_results ( ttl_keys_slice , interval ) do ttl_check_results . call ( slice_start + 20 , slice_size + 20 ) end end end ttl_check_results . call ( 0 , 19 ) end end
Determine stale check results, those that have not executed in
a specified amount of time (check TTL).
Determine stale check results those that have not executed in a specified amount of time ( check TTL ) .
interval
to use for the check TTL result interval.
to use for the check TTL result interval .