Sha256: 601606f02ff657f273f22382ebe338336be0e3e8d9c21e3da3fa15e548686a92

Contents?: true

Size: 1.18 KB

Versions: 129

Compression:

Stored size: 1.18 KB

Contents

# encoding: utf-8
require "spec_helper"

describe LogStash::Api::Commands::Stats do
  include_context "api setup"

  let(:report_method) { :run }
  subject(:report) do
    factory = ::LogStash::Api::CommandFactory.new(LogStash::Api::Service.new(@agent))
   
    factory.build(:stats).send(report_method)
  end

  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

129 entries across 129 versions & 6 rubygems

Version Path
logstash-core-6.8.23-java spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.22-java spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.21-java spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.20-java spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.19-java spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.18-java spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-core-6.8.17-java spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/spec/logstash/api/commands/stats_spec.rb