Sha256: df629fca2afeb4bd6f5763d2dd6d89f98b2a96281756d59a2778793ff63d5226

Contents?: true

Size: 566 Bytes

Versions: 2

Compression:

Stored size: 566 Bytes

Contents

module LogStash
  module Api
    module Commands
      class Base
        attr_reader :service
        
        def initialize(service = LogStash::Api::Service.instance)
          @service = service
        end

        def hostname
          service.agent.node_name
        end

        def uptime
          service.agent.uptime
        end

        def started_at
          (LogStash::Agent::STARTED_AT.to_f * 1000.0).to_i
        end

        def extract_metrics(path, *keys)
          service.extract_metrics(path, *keys)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logstash-core-5.0.0.alpha4.snapshot3-java lib/logstash/api/commands/base.rb
logstash-core-5.0.0.alpha4.snapshot2-java lib/logstash/api/commands/base.rb