Sha256: ea32bd40a1d8c1692ecdec7c2598ad4ff397d3040246fb99d38198ca994fd1e6

Contents?: true

Size: 1 KB

Versions: 63

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8

require File.join(File.dirname(__FILE__), 'helper')

class TestSnapshotter < TuneMyGcTestCase
  def test_init
    snapshots = TuneMyGc::Snapshotter.new
    assert_equal 0, snapshots.size
  end

  def test_take
    snapshots = TuneMyGc::Snapshotter.new
    snapshots.take(:BOOTED)
    assert_equal 1, snapshots.size
    snapshots.clear
  end

  def test_clear
    snapshots = TuneMyGc::Snapshotter.new
    snapshots.take(:BOOTED)
    assert_equal 1, snapshots.size
    snapshots.clear
    assert_equal 0, snapshots.size
  end

  def test_max_samples
    snapshots = TuneMyGc::Snapshotter.new
    2000.times do |i|
      snapshots.take(:MAX)
    end
    assert_equal 2000, snapshots.size
    out, err = capture_io do
      TuneMyGc.logger = Logger.new($stdout)
      snapshots.take(:MORE)
      snapshots.take(:ANOTHER)
    end
    assert_match(/Discarding snapshot/, out)
    assert_equal 2000, snapshots.size
    snapshots.take(:TERMINATED)
    assert_equal 2001, snapshots.size
    snapshots.clear
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
tunemygc-1.0.71 test/test_snapshotter.rb
tunemygc-1.0.69 test/test_snapshotter.rb
tunemygc-1.0.68 test/test_snapshotter.rb
tunemygc-1.0.67 test/test_snapshotter.rb
tunemygc-1.0.65 test/test_snapshotter.rb
tunemygc-1.0.64 test/test_snapshotter.rb
tunemygc-1.0.63 test/test_snapshotter.rb
tunemygc-1.0.62 test/test_snapshotter.rb
tunemygc-1.0.61 test/test_snapshotter.rb
tunemygc-1.0.60 test/test_snapshotter.rb
tunemygc-1.0.59 test/test_snapshotter.rb
tunemygc-1.0.58 test/test_snapshotter.rb
tunemygc-1.0.57 test/test_snapshotter.rb
tunemygc-1.0.56 test/test_snapshotter.rb
tunemygc-1.0.55 test/test_snapshotter.rb
tunemygc-1.0.54 test/test_snapshotter.rb
tunemygc-1.0.53 test/test_snapshotter.rb
tunemygc-1.0.52 test/test_snapshotter.rb
tunemygc-1.0.51 test/test_snapshotter.rb
tunemygc-1.0.50 test/test_snapshotter.rb