vernier 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vernier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-27 00:00:00.000000000 Z
11
+ date: 2023-08-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An experimental profiler
14
14
  email:
@@ -20,17 +20,21 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - CODE_OF_CONDUCT.md
22
22
  - Gemfile
23
- - Gemfile.lock
24
23
  - LICENSE.txt
25
24
  - README.md
26
25
  - Rakefile
27
26
  - bin/console
28
27
  - bin/setup
28
+ - examples/threaded_http_requests.rb
29
29
  - ext/vernier/extconf.rb
30
- - ext/vernier/stack.hh
30
+ - ext/vernier/ruby_type_names.h
31
31
  - ext/vernier/vernier.cc
32
32
  - ext/vernier/vernier.hh
33
33
  - lib/vernier.rb
34
+ - lib/vernier/collector.rb
35
+ - lib/vernier/marker.rb
36
+ - lib/vernier/output/firefox.rb
37
+ - lib/vernier/output/top.rb
34
38
  - lib/vernier/version.rb
35
39
  - sig/vernier.rbs
36
40
  - vernier.gemspec
@@ -49,14 +53,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
53
  requirements:
50
54
  - - ">="
51
55
  - !ruby/object:Gem::Version
52
- version: 2.6.0
56
+ version: 3.2.0
53
57
  required_rubygems_version: !ruby/object:Gem::Requirement
54
58
  requirements:
55
59
  - - ">="
56
60
  - !ruby/object:Gem::Version
57
61
  version: '0'
58
62
  requirements: []
59
- rubygems_version: 3.3.3
63
+ rubygems_version: 3.4.10
60
64
  signing_key:
61
65
  specification_version: 4
62
66
  summary: An experimental profiler
data/Gemfile.lock DELETED
@@ -1,24 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vernier (0.1.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- minitest (5.15.0)
10
- rake (13.0.6)
11
- rake-compiler (1.2.0)
12
- rake
13
-
14
- PLATFORMS
15
- x86_64-linux
16
-
17
- DEPENDENCIES
18
- minitest (~> 5.0)
19
- rake (~> 13.0)
20
- rake-compiler
21
- vernier!
22
-
23
- BUNDLED WITH
24
- 2.3.4
data/ext/vernier/stack.hh DELETED
@@ -1,78 +0,0 @@
1
- #pragma once
2
-
3
- #include "ruby/debug.h"
4
-
5
- #include <iostream>
6
- #include <vector>
7
- #include <memory>
8
- #include <algorithm>
9
-
10
- struct Frame {
11
- VALUE frame;
12
- int line;
13
-
14
- VALUE full_label() const {
15
- return rb_profile_frame_full_label(frame);
16
- }
17
-
18
- VALUE absolute_path() const {
19
- return rb_profile_frame_absolute_path(frame);
20
- }
21
-
22
- VALUE path() const {
23
- return rb_profile_frame_path(frame);
24
- }
25
-
26
- VALUE file() const {
27
- VALUE file = absolute_path();
28
- return NIL_P(file) ? path() : file;
29
- }
30
-
31
- VALUE first_lineno() const {
32
- return rb_profile_frame_first_lineno(frame);
33
- }
34
- };
35
-
36
- struct Stack {
37
- std::unique_ptr<VALUE[]> frames;
38
- std::unique_ptr<int[]> lines;
39
- int _size = 0;
40
-
41
- int size() const {
42
- return _size;
43
- }
44
-
45
- Stack(const VALUE *_frames, const int *_lines, int size) :
46
- _size(size),
47
- frames(std::make_unique<VALUE[]>(size)),
48
- lines(std::make_unique<int[]>(size))
49
- {
50
- std::copy_n(_frames, size, &frames[0]);
51
- std::copy_n(_lines, size, &lines[0]);
52
- }
53
-
54
- Frame frame(int i) const {
55
- if (i >= size()) throw std::out_of_range("nope");
56
- return Frame{frames[i], lines[i]};
57
- }
58
- };
59
-
60
- std::ostream& operator<<(std::ostream& os, const Frame& frame)
61
- {
62
- VALUE label = frame.full_label();
63
- VALUE file = frame.absolute_path();
64
- const char *file_cstr = NIL_P(file) ? "" : StringValueCStr(file);
65
- os << file_cstr << ":" << frame.line << ":in `" << StringValueCStr(label) << "'";
66
- return os;
67
- }
68
-
69
- std::ostream& operator<<(std::ostream& os, const Stack& stack)
70
- {
71
- for (int i = 0; i < stack.size(); i++) {
72
- Frame frame = stack.frame(i);
73
- os << frame << "\n";
74
- }
75
-
76
- return os;
77
- }
78
-