libgfapi-ruby 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e77e350dc931b821a46330717902e9dcc53b145
4
- data.tar.gz: 2edc86242e04fbc8c33e7b5182f35400f9b27cf0
3
+ metadata.gz: cf8eeeaf17075ae2901c8688e5308852d1ecd2ff
4
+ data.tar.gz: e33ba3cc501ebc14ab5146422143ca9a1431b2ab
5
5
  SHA512:
6
- metadata.gz: db150aa3a1b1b3019aeba9ec219f74b94015d877ec47e024ff3306045a323050a19f523a24591600f0ef00edec53f842a2672da6f0d7e444ff2d96dfe04e19b0
7
- data.tar.gz: dcb362fa8d89b90100015cbd45fdbbc4068b07eb19a0347980a43a6b62deb443d7296304997a69c64fece012a68cd43fd9cd11d67e3c4ca93f937c7f295bf742
6
+ metadata.gz: d55eab2b99bb95411fa76539177d61db1d5fdc80354b237cf18b3b3c9258ff081aa12235eaaed99e3f5e5acc1d8ac99716bfd7dffb6c21bdd120213f4ab42c49
7
+ data.tar.gz: 607f4cd3f1b589f98c87e067be6a422c1868daa4180d1d6a71cd9f8c1725d3ebccc2998509d46cdcc8ce8d88580f68f072cecb3e75cf06f9ef02e05f137f6d79
@@ -20,6 +20,6 @@ class GlusterFS::Directory
20
20
  end
21
21
 
22
22
  def exists?
23
- lstat[:st_blocks] > 0
23
+ lstat[:st_size] > 0
24
24
  end
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module GlusterFS
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -54,7 +54,7 @@ module GlusterFS
54
54
  lstat[:st_rdev].should == 0
55
55
  lstat[:st_size].should_not == 0
56
56
  lstat[:st_blksize].should == 0
57
- lstat[:st_blocks].should be > 1
57
+ # lstat[:st_blocks].should be > 0 # fails in some setups, blocks == 0
58
58
  lstat[:st_atime].should_not == 0
59
59
  lstat[:st_mtime].should_not == 0
60
60
  lstat[:st_ctime].should_not == 0
@@ -9,8 +9,6 @@ module GlusterFS
9
9
 
10
10
  describe 'memleaks' do
11
11
 
12
- let(:iterations) { (ENV['MEM_ITERATIONS'] || 100).to_i }
13
-
14
12
  before(:all) do
15
13
  if ENV['MEM_PRINT']
16
14
  puts "GC Settings"
@@ -22,7 +20,7 @@ module GlusterFS
22
20
  puts "Initial memory use: #{GlusterFS.mem_size}"
23
21
  Mass.print
24
22
  else
25
- puts "Set MEM_PRINT=1 MEM_ITERATIONS=10000 to get a better memory stress test"
23
+ puts "see spec/spec_helper.rb for memory leak test options"
26
24
  end
27
25
  end
28
26
 
@@ -34,9 +32,10 @@ module GlusterFS
34
32
  let(:root_dir) { Directory.new(volume, '/memtest-root') }
35
33
 
36
34
  # Mem leak here! Only run when MEM_ITERATIONS is provided.
37
- if ENV['MEM_ITERATIONS']
35
+ if ENV['MEM_VOLUME_ITERATIONS']
38
36
  context 'mount / unmount volume' do
39
37
  specify do
38
+ iterations = GFS_MEM_VOL_ITERATIONS
40
39
  puts "Volume Iterations: #{iterations}"
41
40
  mem_size_before = GlusterFS.mem_size
42
41
  iterations.times do |i|
@@ -57,6 +56,7 @@ module GlusterFS
57
56
  before { root_dir.create }
58
57
  after { root_dir.delete }
59
58
  specify do
59
+ iterations = GFS_MEM_DIR_ITERATIONS
60
60
  puts "Dir Iterations: #{iterations}"
61
61
  mem_size_before = GlusterFS.mem_size
62
62
  iterations.times do |i|
@@ -75,6 +75,7 @@ module GlusterFS
75
75
  before { root_dir.create }
76
76
  after { root_dir.delete }
77
77
  specify do
78
+ iterations = GFS_MEM_FILE_ITERATIONS
78
79
  puts "File Iterations: #{iterations}"
79
80
  mem_size_before = GlusterFS.mem_size
80
81
  iterations.times do |i|
@@ -5,7 +5,6 @@ module GlusterFS
5
5
 
6
6
  describe 'performance' do
7
7
  let(:file_mount_point) { ENV['GFS_MOUNT_DIR'] || '/mnt/dist-volume' }
8
- let(:iterations) { (ENV['PERF_ITERATIONS'] || 100).to_i }
9
8
  let!(:random_blob) do
10
9
  '0' * 1048576 * 5 # 5MB
11
10
  end
@@ -13,6 +12,8 @@ module GlusterFS
13
12
  specify 'native file system operations' do
14
13
  test_dir ="/tmp/fs-perftest-root"
15
14
  FileUtils.rm_rf test_dir
15
+ iterations = GFS_PERF_NATIVE_ITERATIONS
16
+ puts "Natife FS iterations: #{iterations}"
16
17
  time = Benchmark.realtime do
17
18
  FileUtils.mkdir_p test_dir
18
19
  iterations.times do |i|
@@ -33,6 +34,8 @@ module GlusterFS
33
34
  specify 'mounted file system operations' do
34
35
  test_dir ="#{file_mount_point}/mnt-perftest-root"
35
36
  FileUtils.rm_rf test_dir
37
+ iterations = GFS_PERF_MOUNT_ITERATIONS
38
+ puts "Mounted FS iterations: #{iterations}"
36
39
  time = Benchmark.realtime do
37
40
  FileUtils.mkdir_p test_dir
38
41
  iterations.times do |i|
@@ -55,6 +58,8 @@ module GlusterFS
55
58
  specify 'api operations' do
56
59
  test_dir ="/gfs-perftest-root"
57
60
  FileUtils.rm_rf "#{file_mount_point}/test_dir"
61
+ iterations = GFS_PERF_API_ITERATIONS
62
+ puts "GFS API iterations: #{iterations}"
58
63
  time = Benchmark.realtime do
59
64
  gfs_test_dir = Directory.new(volume, test_dir)
60
65
  gfs_test_dir.create
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,18 @@ require 'glusterfs'
4
4
  GFS_SERVER_HOST = ENV['GFS_SERVER_HOST'] || '127.0.0.1'
5
5
  GFS_SERVER_PORT = (ENV['GFS_SERVER_PORT'] || 24007).to_i
6
6
  GFS_VOLUME = ENV['GFS_VOLUME_NAME'] || 'dist-volume'
7
+ GFS_FS_MOUNT = ENV['GFS_FS_MOUNT'] || '/mnt/dist-volume'
8
+
9
+ # Settings for stress tests
10
+ GFS_MEM_DIR_ITERATIONS = ENV['MEM_DIR_ITERATIONS'] || 50
11
+ GFS_MEM_FILE_ITERATIONS = ENV['MEM_FILE_ITERATIONS'] || 50
12
+ GFS_MEM_VOL_ITERATIONS = ENV['MEM_VOL_ITERATIONS'] || 50
13
+
14
+ GFS_MEM_PRINT = ENV['MEM_PRINT'] || false
15
+
16
+ GFS_PERF_NATIVE_ITERATIONS = ENV['PERF_NATIVE_ITERATIONS'] || 10
17
+ GFS_PERF_MOUNT_ITERATIONS = ENV['PERF_MOUNT_ITERATIONS'] || 10
18
+ GFS_PERF_API_ITERATIONS = ENV['PERF_API_ITERATIONS'] || 10
7
19
 
8
20
  RSpec.configure do |config|
9
21
  config.color_enabled = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libgfapi-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Varaneckas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi