Sha256: 43a6801c201e0b8bf065430854760cd6b17ee84e00d687ed57eecf5ee669b919

Contents?: true

Size: 1.08 KB

Versions: 54

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8
require_relative "../../spec_helper"

describe LogStash::Api::Commands::Stats do

  let(:report_method) { :run }
  subject(:report) { do_request { report_class.new.send(report_method) } }

  let(:report_class) { described_class }

  describe "#events" do
    let(:report_method) { :events }

    it "return events information" do
      expect(report.keys).to include(:in, :filtered, :out)
    end
  end
  
  describe "#hot_threads" do
    let(:report_method) { :hot_threads }
    
    it "should return hot threads information as a string" do
      expect(report.to_s).to be_a(String)
    end

    it "should return hot threads info as a hash" do
      expect(report.to_hash).to be_a(Hash)
    end
  end

  describe "memory stats" do
    let(:report_method) { :memory }
      
    it "return hot threads information" do
      expect(report).not_to be_empty
    end

    it "return heap information" do
      expect(report.keys).to include(:heap_used_in_bytes)
    end

    it "return non heap information" do
      expect(report.keys).to include(:non_heap_used_in_bytes)
    end

  end
end

Version data entries

54 entries across 53 versions & 11 rubygems

Version Path
logstash-core-5.2.1-java spec/api/lib/commands/stats.rb
logstash-core-5.2.0-java spec/api/lib/commands/stats.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/logstash-core-5.1.1.1-java/spec/api/lib/commands/stats.rb
logstash-core-5.1.2-java spec/api/lib/commands/stats.rb
logstash-core-5.1.1.1-java spec/api/lib/commands/stats.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/spec/api/lib/commands/stats.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/spec/api/lib/commands/stats.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/logstash-core-5.1.2.snapshot1-java/spec/api/lib/commands/stats.rb
logstash-core-5.0.2-java spec/api/lib/commands/stats.rb
logstash-core-5.0.1-java spec/api/lib/commands/stats.rb
logstash-core-5.0.0-java spec/api/lib/commands/stats.rb
logstash-core-5.0.0.pre.rc1-java spec/api/lib/commands/stats.rb
logstash-core-5.0.0.pre.beta1-java spec/api/lib/commands/stats.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/commands/stats.rb