lib/sensu/client/process.rb
def calculate_check_execution_splay(check)
        key = [@settings[:client][:name], check[:name]].join(":")
        splay_hash = Digest::MD5.digest(key).unpack("Q<").first
        current_time = (Time.now.to_f * 1000).to_i
        (splay_hash - current_time) % (check[:interval] * 1000) / 1000.0
      end
# Calculate a check execution splay, taking into account the
# current time and the execution interval to ensure it's
# consistent between process restarts.
#
# @param check [Hash] definition.
Calculate a check execution splay, taking into account the
current time and the execution interval to ensure it's
consistent between process restarts.
Calculate a check execution splay taking into account the current time and the execution interval to ensure it ' s consistent between process restarts .
def calculate_check_execution_splay(check)
        key = [@settings[:client][:name], check[:name]].join(":")
        splay_hash = Digest::MD5.digest(key).unpack("Q<").first
        current_time = (Time.now.to_f * 1000).to_i
        (splay_hash - current_time) % (check[:interval] * 1000) / 1000.0
      end
def calculate_check_execution_splay ( check ) key = [ @settings [ :client ] [ :name ] , check [ :name ] ] . join ( ":" ) splay_hash = Digest :: MD5 . digest ( key ) . unpack ( "Q<" ) . first current_time = ( Time . now . to_f * 1000 ) . to_i ( splay_hash - current_time ) % ( check [ :interval ] * 1000 ) / 1000.0 end
Calculate a check execution splay, taking into account the
current time and the execution interval to ensure it's
consistent between process restarts.
Calculate a check execution splay taking into account the current time and the execution interval to ensure it ' s consistent between process restarts .
check
None