time_bandits 0.12.4 → 0.12.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9824d9fcd5eef40eebbf628d042f34604f310e563570c62e488bb8084533f24a
4
- data.tar.gz: c7bc40bcbce473400e9216268bf2abc10f7c1d6fbfc0ac90305bfaba444e8706
3
+ metadata.gz: be90aa917ea9d4256501dc921da7fea5c9f1c9608f89fc7e5e5dace634b0353f
4
+ data.tar.gz: 29d87ff61dfa62a3202434df9d687ae9dc8e9d5e6e4b9e0ef4709049b7abee51
5
5
  SHA512:
6
- metadata.gz: 3d78ca08b9d112fd2e4365b7df522badce8e57965d469dac2cf65c5ea51753078021729e066d798781e040140e306af4f274fed6da4b9246a7866c44bff6fb92
7
- data.tar.gz: 1ac34b522398bdf6419a53e28fd068e434cc538c669160cc423a8a9590443724e1d7acfe4ecb40fe50f2268c1c30f8882e137e5907c6e66ac960e64d8023ae97
6
+ metadata.gz: e6692b8d8d10889442cc67f583fb6b98535f6a7ab3b060698c9dfef256f933bb976670dd1e672ba16a63d085d5238ade7704e7c1e9240ffc3da67d60e9a33435
7
+ data.tar.gz: b98ab1c3669dd66162199ad6a78bf113a598b8836a0a793404fa1dd28248fc43751ad32439ae03b3732a16f7476ad2109cacdc2c9cc7b57eec24ecb07475c460
@@ -13,7 +13,7 @@ jobs:
13
13
 
14
14
  strategy:
15
15
  matrix:
16
- ruby-version: [3.0.3, 2.7.5, 2.6.9]
16
+ ruby-version: [3.1.0, 3.0.3, 2.7.5, 2.6.9]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v2
data/Appraisals CHANGED
@@ -4,7 +4,7 @@ appraisals = [
4
4
  ]
5
5
 
6
6
  appraisals.insert(0, "5.2.6") if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0.0")
7
- appraisals << "7.0.0" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
7
+ appraisals << "7.0.1" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
8
8
 
9
9
  appraisals.each do |rails_version|
10
10
  appraise "activesupport-#{rails_version}" do
@@ -29,6 +29,8 @@ module TimeBandits
29
29
 
30
30
  if GC.respond_to?(:time)
31
31
  def _get_gc_time; GC.time; end
32
+ elsif GC.respond_to?(:total_time)
33
+ def _get_gc_time; GC.total_time / 1000; end
32
34
  else
33
35
  def _get_gc_time; 0; end
34
36
  end
@@ -40,7 +42,8 @@ module TimeBandits
40
42
  if GC.respond_to?(:total_malloced_bytes)
41
43
  def _get_allocated_size; GC.total_malloced_bytes; end
42
44
  else
43
- def _get_allocated_size; 0; end
45
+ # this will wrap around :malloc_increase_bytes_limit so is not really correct
46
+ def _get_allocated_size; GC.stat(:malloc_increase_bytes); end
44
47
  end
45
48
 
46
49
  if GC.respond_to?(:heap_slots)
@@ -81,7 +84,9 @@ module TimeBandits
81
84
  end
82
85
 
83
86
  def allocated_size
84
- _get_allocated_size - @allocated_size
87
+ new_size = _get_allocated_size
88
+ old_size = @allocated_size
89
+ new_size <= old_size ? new_size : new_size - old_size
85
90
  end
86
91
 
87
92
  def heap_growth
@@ -1,3 +1,3 @@
1
1
  module TimeBandits
2
- VERSION = "0.12.4"
2
+ VERSION = "0.12.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_bandits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-02 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thread_variables