Sha256: 4084057f6ce5be1882619ccccf2a675e29ee3681340ee90e686f1715fbc57a77

Contents?: true

Size: 1.13 KB

Versions: 14

Compression:

Stored size: 1.13 KB

Contents

# encoding: utf-8
module LogStash
  module Api
    module Modules
      class Stats < ::LogStash::Api::Modules::Base
        def stats_command
          factory.build(:stats)
        end

        # return hot threads information
        get "/jvm/hot_threads" do
          top_threads_count = params["threads"] || 3
          ignore_idle_threads = params["ignore_idle_threads"] || true
          options = {
            :threads => top_threads_count.to_i,
            :ignore_idle_threads => as_boolean(ignore_idle_threads)
          }

          respond_with(stats_command.hot_threads(options))
        end

        # return hot threads information
        get "/jvm/memory" do
          respond_with({ :memory => stats_command.memory })
        end

        get "/?:filter?" do
          payload = {
            :events => stats_command.events,
            :jvm => {
              :timestamp => stats_command.started_at,
              :uptime_in_millis => stats_command.uptime,
              :memory => stats_command.memory
            }
          }
          respond_with(payload, {:filter => params["filter"]})
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/logstash-core-5.0.0-java/lib/logstash/api/modules/stats.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/logstash-core-5.1.1.1-java/lib/logstash/api/modules/stats.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.1.1.1-java/lib/logstash/api/modules/stats.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/logstash-core-5.1.1.1-java/lib/logstash/api/modules/stats.rb
logstash-core-5.1.2-java lib/logstash/api/modules/stats.rb
logstash-core-5.1.1.1-java lib/logstash/api/modules/stats.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/lib/logstash/api/modules/stats.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/lib/logstash/api/modules/stats.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/lib/logstash/api/modules/stats.rb
logstash-core-5.0.2-java lib/logstash/api/modules/stats.rb
logstash-core-5.0.1-java lib/logstash/api/modules/stats.rb
logstash-core-5.0.0-java lib/logstash/api/modules/stats.rb
logstash-core-5.0.0.pre.rc1-java lib/logstash/api/modules/stats.rb
logstash-core-5.0.0.pre.beta1-java lib/logstash/api/modules/stats.rb