Sha256: 4ae047a52c0c1c4673c252ce99d80e0d72b033933d32b1cb4fb2a352fe85ff46

Contents?: true

Size: 1.16 KB

Versions: 29

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe JRMonitor::Report::Memory do

  let(:report) { subject.generate }

  it 'pulls usage for heap and non heap memory' do
    expect(report.keys).to include("heap")
    expect(report.keys).to include("non_heap")
  end

  context "#heap memory"do

    let(:report) { subject.generate_with_heap }

    it "pull usage for each space" do
      spaces = ["PS Survivor Space", "PS Old Gen", "PS Eden Space"]
      report.keys.each do |space|
        expect(spaces).to include(space);
      end
    end

    it "pull usage and peak info for each space" do
      report.each_pair do |_, values|
        expect(values).to include("usage.used" => kind_of(Fixnum))
        expect(values).to include("usage.max" => kind_of(Fixnum))
        expect(values).to include("usage.committed" => kind_of(Fixnum))
        expect(values).to include("usage.init" => kind_of(Fixnum))
        expect(values).to include("peak.used" => kind_of(Fixnum))
        expect(values).to include("peak.max" => kind_of(Fixnum))
        expect(values).to include("peak.committed" => kind_of(Fixnum))
        expect(values).to include("peak.init" => kind_of(Fixnum))
      end
    end
  end

end

Version data entries

29 entries across 28 versions & 12 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/jrmonitor-0.4.2/spec/lib/memory_monitor_spec.rb