gctrack 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: 4388d6afd81b4cfb83867cb06a566660b460142d
4
- data.tar.gz: b8f4b6ed72cee918d87ad60161b08eeae4875645
2
+ SHA256:
3
+ metadata.gz: 65d1faae29e8e0e8a7ebafce07de5e62a09c71f4196fac35ef29afe8eeacb6d9
4
+ data.tar.gz: 73cf8d0b993f6a984eacb47686b1e9c58f1d3c59f0cc4a8b88ca07d33399be61
5
5
  SHA512:
6
- metadata.gz: 6e52f68e61eab3e758420725acf7f23b124b4c7230e03529291e2710bc53a509ddd5006636c63f885c41971e8a6a6b4911b60a9f59480ad6b339bed0e54fdd61
7
- data.tar.gz: c138d07a3ac9685280b1bde07397e82d31ba5402a434c0c5ee543841dbe5d8ebbff5a882989c60145a06520cf82a2b0bc944aa007500111c4b41ae33ba0d964a
6
+ metadata.gz: 0d1b983c3bbf19a35c27a21eb5f48e5109d7e189950c5ab86082ee933380d8d3358cd6078ad78c1c653064657731052eb48fc771deda0e7fae854dff312dcca7
7
+ data.tar.gz: 2b3fdea5f648907afec6add265244161e2559767166e61adfbf74edc96a9eb1177a21110d0f43c6df6756f6f4b9f535b74907a2836b0ada514c0e614cd679f7f
@@ -3,3 +3,4 @@ language: ruby
3
3
  rvm:
4
4
  - '2.3.3'
5
5
  - '2.4.1'
6
+ - '2.5.3'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gctrack (0.1.0)
4
+ gctrack (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -37,4 +37,4 @@ DEPENDENCIES
37
37
  test-unit
38
38
 
39
39
  BUNDLED WITH
40
- 1.15.3
40
+ 1.17.3
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Scott Francis <scott.francis@shopify.com>
3
+ Copyright (c) 2017 Shopify Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -13,7 +13,7 @@ GCTrack is published to [rubygems.org](https://rubygems.org/gems/gctrack).
13
13
  Simply add it as a dependency to your `Gemfile`
14
14
 
15
15
  ```ruby
16
- gem 'gctrack', '~> 0.1.0'
16
+ gem 'gctrack', '~> 0.1.1'
17
17
  ```
18
18
 
19
19
  #### #2 Enable the extension
@@ -32,12 +32,8 @@ nanotime()
32
32
  static inline void
33
33
  add_gc_cycle(uint64_t duration)
34
34
  {
35
- record_t *record = last_record;
36
- while (record) {
37
- record->cycles = record->cycles + 1;
38
- record->duration = record->duration + duration;
39
- record = record->parent;
40
- }
35
+ last_record->cycles += 1;
36
+ last_record->duration += duration;
41
37
  }
42
38
 
43
39
  static inline bool
@@ -49,7 +45,7 @@ gctracker_enabled()
49
45
  static void
50
46
  gctracker_hook(VALUE tpval, void *data)
51
47
  {
52
- if (!gctracker_enabled() && !last_record) {
48
+ if (!last_record || !gctracker_enabled()) {
53
49
  return;
54
50
  }
55
51
  rb_trace_arg_t *tparg = rb_tracearg_from_tracepoint(tpval);
@@ -149,6 +145,11 @@ gctracker_end_record(int argc, VALUE *argv, VALUE klass)
149
145
  }
150
146
  record_t *record = last_record;
151
147
  last_record = record->parent;
148
+
149
+ if (last_record) {
150
+ last_record->cycles += record->cycles;
151
+ last_record->duration += record->duration;
152
+ }
152
153
 
153
154
  VALUE stats = rb_ary_new2(2);
154
155
  rb_ary_store(stats, 0, ULONG2NUM(record->cycles));
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gctrack'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.summary = 'Track Ruby GC events'
5
5
  s.description = <<-DOC
6
6
  This gem can be used to track Ruby GC tracepoints that are normally only visible through GC extensions.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gctrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Francis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-11 00:00:00.000000000 Z
12
+ date: 2019-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.5.2
84
+ rubygems_version: 2.7.6
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Track Ruby GC events