Sha256: a8d1e2b1e10ba2d8b67a15f85d2f89d21a6ebb5136d7a7e1a531c533939b746c

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
require "logstash/api/modules/base"

module LogStash
  module Api
    module Modules
      class Node < ::LogStash::Api::Modules::Base
        def node
          factory.build(:node)
        end
        
        get "/" do
          respond_with node.all
        end

        get "/os" do
          respond_with :os => node.os
        end

        get "/jvm" do
          respond_with :jvm => node.jvm          
        end

        get "/pipeline" do
          respond_with :pipeline => node.pipeline
        end
        
        get "/hot_threads" do
          ignore_idle_threads = params["ignore_idle_threads"] || true

          options = {
            :ignore_idle_threads => as_boolean(ignore_idle_threads),
            :human => params.has_key?("human")
          }
          options[:threads] = params["threads"].to_i if params.has_key?("threads")

          as = options[:human] ? :string : :json
          respond_with({:hot_threads => node.hot_threads(options)}, {:as => as})
        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/modules/node.rb
logstash-core-5.0.0.alpha4.snapshot2-java lib/logstash/api/modules/node.rb