stackprof 0.2.18 → 0.2.19

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: 2c802ba8d0dfa813e939679507d70376e7dc33924369bb9d767523cfa5faed31
4
- data.tar.gz: 5defbe29a222a82e3b6901ed10b0c73d962ed6a650b14b0c3cd3c231c27c0e39
3
+ metadata.gz: 6662250e5e20ee3388bfce740a053c83e53fe9304b518ad22f0ce9ffc5d10077
4
+ data.tar.gz: 7480e1896e253bd530573fc2f66b3d7690db97bee3f892c77729b75c2dc8c94e
5
5
  SHA512:
6
- metadata.gz: 0e585cf066f4008907975726f22185184210e375ca6fe28e51fe44fca7fe53e2cdc414482dcba3e413da2238a879cb5fa58530106ad5f8cb217fc6cee1bf4a2b
7
- data.tar.gz: 7b2d08fbd2d70c803f06f42c15e7978871f01c343f3d149f2a63b781d4e074542f445e9a809bdaab1921e779ec9d868159fedc752103faf86c45ddfe7239b74a
6
+ metadata.gz: 3f92e6401b16f83d9398b94e8b0506f597a785a19e1552245f39e1c77ab0c2d3d40186b8b05f91972b6d899995718c28e1724acff97248d497a3768deed601bb
7
+ data.tar.gz: 0663a1cdac8730bcbc4dd68750fffa6885b72eca7c37915191b6ff44ff101349ba274648b6641531c1bfff34144179b76d527ca8426db91af2c0536629f6ee65
@@ -615,7 +615,7 @@ stackprof_buffer_sample(void)
615
615
  struct timestamp_t t;
616
616
  capture_timestamp(&t);
617
617
  start_timestamp = timestamp_usec(&t);
618
- timestamp_delta = delta_usec(&t, &_stackprof.last_sample_at);
618
+ timestamp_delta = delta_usec(&_stackprof.last_sample_at, &t);
619
619
  }
620
620
 
621
621
  num = rb_profile_frames(0, sizeof(_stackprof.frames_buffer) / sizeof(VALUE), _stackprof.frames_buffer, _stackprof.lines_buffer);
@@ -638,7 +638,7 @@ stackprof_record_gc_samples(void)
638
638
 
639
639
  // We don't know when the GC samples were actually marked, so let's
640
640
  // assume that they were marked at a perfectly regular interval.
641
- delta_to_first_unrecorded_gc_sample = delta_usec(&t, &_stackprof.last_sample_at) - (_stackprof.unrecorded_gc_samples - 1) * NUM2LONG(_stackprof.interval);
641
+ delta_to_first_unrecorded_gc_sample = delta_usec(&_stackprof.last_sample_at, &t) - (_stackprof.unrecorded_gc_samples - 1) * NUM2LONG(_stackprof.interval);
642
642
  if (delta_to_first_unrecorded_gc_sample < 0) {
643
643
  delta_to_first_unrecorded_gc_sample = 0;
644
644
  }
data/lib/stackprof.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "stackprof/stackprof"
2
2
 
3
3
  module StackProf
4
- VERSION = '0.2.18'
4
+ VERSION = '0.2.19'
5
5
  end
6
6
 
7
7
  StackProf.autoload :Report, "stackprof/report.rb"
data/stackprof.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'stackprof'
3
- s.version = '0.2.18'
3
+ s.version = '0.2.19'
4
4
  s.homepage = 'http://github.com/tmm1/stackprof'
5
5
 
6
6
  s.authors = 'Aman Gupta'
@@ -131,6 +131,7 @@ class StackProfTest < MiniTest::Test
131
131
  profile = StackProf.run(mode: :custom, raw: true) do
132
132
  10.times do
133
133
  StackProf.sample
134
+ sleep 0.0001
134
135
  end
135
136
  end
136
137
 
@@ -153,6 +154,10 @@ class StackProfTest < MiniTest::Test
153
154
  assert_equal 10, profile[:raw_timestamp_deltas].size
154
155
  total_duration = after_monotonic - before_monotonic
155
156
  assert_operator profile[:raw_timestamp_deltas].inject(&:+), :<, total_duration
157
+
158
+ profile[:raw_timestamp_deltas].each do |delta|
159
+ assert_operator delta, :>, 0
160
+ end
156
161
  end
157
162
 
158
163
  def test_metadata
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -94,9 +94,9 @@ licenses:
94
94
  - MIT
95
95
  metadata:
96
96
  bug_tracker_uri: https://github.com/tmm1/stackprof/issues
97
- changelog_uri: https://github.com/tmm1/stackprof/blob/v0.2.18/CHANGELOG.md
98
- documentation_uri: https://www.rubydoc.info/gems/stackprof/0.2.18
99
- source_code_uri: https://github.com/tmm1/stackprof/tree/v0.2.18
97
+ changelog_uri: https://github.com/tmm1/stackprof/blob/v0.2.19/CHANGELOG.md
98
+ documentation_uri: https://www.rubydoc.info/gems/stackprof/0.2.19
99
+ source_code_uri: https://github.com/tmm1/stackprof/tree/v0.2.19
100
100
  post_install_message:
101
101
  rdoc_options: []
102
102
  require_paths: