lib/sensu/api/utilities/transport_info.rb
def transport_info
          info = {
            :name => @settings[:transport][:name],
            :keepalives => {
              :messages => nil,
              :consumers => nil
            },
            :results => {
              :messages => nil,
              :consumers => nil
            },
            :connected => false
          }
          if @transport.connected?
            @transport.stats("keepalives") do |stats|
              info[:keepalives] = stats
              if @transport.connected?
                @transport.stats("results") do |stats|
                  info[:results] = stats
                  info[:connected] = @transport.connected?
                  yield(info)
                end
              else
                yield(info)
              end
            end
          else
            yield(info)
          end
        end
# Retreive the Sensu Transport info, if the API is connected
# to it, keepalive messages and consumers, and results
# messages and consumers.
#
# @yield [Hash] passes Transport info to the callback/block.
Retreive the Sensu Transport info, if the API is connected
to it, keepalive messages and consumers, and results
messages and consumers.
Retreive the Sensu Transport info if the API is connected to it keepalive messages and consumers and results messages and consumers .
def transport_info
          info = {
            :name => @settings[:transport][:name],
            :keepalives => {
              :messages => nil,
              :consumers => nil
            },
            :results => {
              :messages => nil,
              :consumers => nil
            },
            :connected => false
          }
          if @transport.connected?
            @transport.stats("keepalives") do |stats|
              info[:keepalives] = stats
              if @transport.connected?
                @transport.stats("results") do |stats|
                  info[:results] = stats
                  info[:connected] = @transport.connected?
                  yield(info)
                end
              else
                yield(info)
              end
            end
          else
            yield(info)
          end
        end
def transport_info info = { :name => @settings [ :transport ] [ :name ] , :keepalives => { :messages => nil , :consumers => nil } , :results => { :messages => nil , :consumers => nil } , :connected => false } if @transport . connected? @transport . stats ( "keepalives" ) do | stats | info [ :keepalives ] = stats if @transport . connected? @transport . stats ( "results" ) do | stats | info [ :results ] = stats info [ :connected ] = @transport . connected? yield ( info ) end else yield ( info ) end end else yield ( info ) end end
Retreive the Sensu Transport info, if the API is connected
to it, keepalive messages and consumers, and results
messages and consumers.
Retreive the Sensu Transport info if the API is connected to it keepalive messages and consumers and results messages and consumers .
]
passes Transport info to the callback/block.
passes Transport info to the callback / block .