Sha256: e54d55baff0002af1c59908227f6a9afc3abd7d925a4c41e6cd5803ee699dc65

Contents?: true

Size: 1.17 KB

Versions: 84

Compression:

Stored size: 1.17 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,
            },
            :os => stats_command.os
          }
          respond_with(payload, {:filter => params["filter"]})
        end
      end
    end
  end
end

Version data entries

84 entries across 81 versions & 8 rubygems

Version Path
logstash-core-6.0.0.beta1-java lib/logstash/api/modules/stats.rb
logstash-core-5.5.1-java lib/logstash/api/modules/stats.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/logstash-core-5.5.1.snapshot1-java/lib/logstash/api/modules/stats.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.5.1.snapshot1-java/lib/logstash/api/modules/stats.rb
logstash-core-5.5.1.snapshot1-java lib/logstash/api/modules/stats.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.5.0-java/lib/logstash/api/modules/stats.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/lib/logstash/api/modules/stats.rb
logstash-core-5.5.0-java lib/logstash/api/modules/stats.rb
logstash-core-5.4.3-java lib/logstash/api/modules/stats.rb
logstash-core-5.4.2-java lib/logstash/api/modules/stats.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/lib/logstash/api/modules/stats.rb
logstash-core-6.0.0.alpha2-java lib/logstash/api/modules/stats.rb
logstash-core-5.4.1-java lib/logstash/api/modules/stats.rb
logstash-core-5.3.3-java lib/logstash/api/modules/stats.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/lib/logstash/api/modules/stats.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/logstash-core-5.2.1-java/lib/logstash/api/modules/stats.rb
logstash-core-6.0.0.alpha1-java lib/logstash/api/modules/stats.rb
logstash-core-5.4.0-java lib/logstash/api/modules/stats.rb
logstash-core-5.3.2-java lib/logstash/api/modules/stats.rb
logstash-core-5.3.1-java lib/logstash/api/modules/stats.rb