lib/sensu/server/process.rb
def publish_proxy_check_requests(clients, check)
        client_count = clients.length
        splay = 0
        if check[:proxy_requests][:splay]
          interval = check[:interval]
          if check[:cron]
            interval = determine_check_cron_time(check)
          end
          unless interval.nil?
            splay_coverage = check[:proxy_requests].fetch(:splay_coverage, 90)
            splay = interval * (splay_coverage / 100.0) / client_count
          end
        end
        splay_timer = 0
        clients.each do |client|
          unless splay == 0
            EM::Timer.new(splay_timer) do
              publish_proxy_check_request(client, check)
            end
            splay_timer += splay
          else
            publish_proxy_check_request(client, check)
          end
        end
      end
# Publish proxy check requests for one or more clients. This
# method can optionally splay proxy check requests, evenly, over
# a period of time, determined by the check interval and a
# configurable splay coverage percentage. For example, splay
# proxy check requests over 60s * 90%, 54s, leaving 6s for the
# last proxy check execution before the the next round of proxy
# check requests for the same check. The
# `publish_proxy_check_request() method is used to publish the
# proxy check requests.
#
# @param clients [Array] of client definitions.
# @param check [Hash] definition.
Publish proxy check requests for one or more clients. This
method can optionally splay proxy check requests, evenly, over
a period of time, determined by the check interval and a
configurable splay coverage percentage. For example, splay
proxy check requests over 60s * 90%, 54s, leaving 6s for the
last proxy check execution before the the next round of proxy
check requests for the same check. The
`publish_proxy_check_request() method is used to publish the
proxy check requests.
Publish proxy check requests for one or more clients . This method can optionally splay proxy check requests evenly over a period of time determined by the check interval and a configurable splay coverage percentage . For example splay proxy check requests over 60s * 90% 54s leaving 6s for the last proxy check execution before the the next round of proxy check requests for the same check . The ` publish_proxy_check_request () method is used to publish the proxy check requests .
def publish_proxy_check_requests(clients, check)
        client_count = clients.length
        splay = 0
        if check[:proxy_requests][:splay]
          interval = check[:interval]
          if check[:cron]
            interval = determine_check_cron_time(check)
          end
          unless interval.nil?
            splay_coverage = check[:proxy_requests].fetch(:splay_coverage, 90)
            splay = interval * (splay_coverage / 100.0) / client_count
          end
        end
        splay_timer = 0
        clients.each do |client|
          unless splay == 0
            EM::Timer.new(splay_timer) do
              publish_proxy_check_request(client, check)
            end
            splay_timer += splay
          else
            publish_proxy_check_request(client, check)
          end
        end
      end
def publish_proxy_check_requests ( clients , check ) client_count = clients . length splay = 0 if check [ :proxy_requests ] [ :splay ] interval = check [ :interval ] if check [ :cron ] interval = determine_check_cron_time ( check ) end unless interval . nil? splay_coverage = check [ :proxy_requests ] . fetch ( :splay_coverage , 90 ) splay = interval * ( splay_coverage / 100.0 ) / client_count end end splay_timer = 0 clients . each do | client | unless splay == 0 EM :: Timer . new ( splay_timer ) do publish_proxy_check_request ( client , check ) end splay_timer += splay else publish_proxy_check_request ( client , check ) end end end
Publish proxy check requests for one or more clients.
Publish proxy check requests for one or more clients .
clients
of client definitions.
of client definitions .
check
None