Sha256: 9f1f406091d3a8bc75044024c143ee86f0c0e9bfed2a4b305bc7e43b4de72726

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

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

module LogStash
  module Api
    module Modules
      class Node < ::LogStash::Api::Modules::Base
        # return hot threads information
        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")

          stats = factory.build(:stats)
          as    = options[:human] ? :string : :json
          respond_with(stats.hot_threads(options), {:as => as})
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logstash-core-5.0.0.alpha4.snapshot1-java lib/logstash/api/modules/node.rb