Sha256: f1d34f314a31912c5baa4ad2fd5c4b22ce58121fd2653da1fdbff12d12b5dbd9

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

module LitmusPaper
  class AgentCheckHandler
    def self.handle(service)
      output = []
      health = LitmusPaper.check_service(service)
      if health.nil?
        output << "failed#NOT_FOUND"
      else
        case health.direction
        when :up, :health
          output << "ready" # administrative state
          output << "up" # operational state
        when :down
          output << "drain" # administrative state
        when :none
          if health.ok?
            output << "ready" # administrative state
            output << "up" # operational state
          else
            output << "down" # operational state
          end
        end
        output << "#{health.value.to_s}%"
      end
      output.join("\t")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
litmus_paper-1.1.1 lib/litmus_paper/agent_check_handler.rb
litmus_paper-1.1.0 lib/litmus_paper/agent_check_handler.rb
litmus_paper-1.0.0 lib/litmus_paper/agent_check_handler.rb
litmus_paper-0.9.9 lib/litmus_paper/agent_check_handler.rb
litmus_paper-0.9.7 lib/litmus_paper/agent_check_handler.rb