profiling 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/bin/console +4 -3
- data/lib/profiling.rb +3 -1
- data/lib/profiling/configuration.rb +3 -2
- data/lib/profiling/engine.rb +13 -12
- data/lib/profiling/version.rb +3 -1
- metadata +28 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 741bfb137712d65a0280ccde370760c2f9993e07fc5f247ee7e796fa99913caa
|
4
|
+
data.tar.gz: 90bf533152d0f512c381cb79ef3cffb201c4905bfe59876e1e43ea27939f5b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e11902ff7667a4b38e19c9ee9e60a0f2301ad86d28d30807b1b7e8fa9c6aa201b15e7ef58585d16f39ff7487680a8a84a1b0a348aa3ce3b3a0ddc1c32eb6664c
|
7
|
+
data.tar.gz: 7ebb82d01f71104d1ba1be6671555db8bcd8319a06719f46b500809fe535b611444db4d8b167cb49971c4f6a57518199ffdc74581e4f94ead8327fa8e4f5a5a4
|
data/README.md
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'profiling'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "profiling"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/lib/profiling.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
require 'ostruct'
|
3
5
|
|
4
|
-
Dir[File.dirname(__FILE__)
|
6
|
+
Dir["#{File.dirname(__FILE__)}/profiling/*.rb"].each { |file| require file }
|
5
7
|
|
6
8
|
class Profiler
|
7
9
|
extend Configuration
|
data/lib/profiling/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Profiler
|
2
4
|
module Engine
|
3
|
-
|
4
5
|
def run(*args)
|
5
6
|
label = args.find { |a| a.is_a?(String) }
|
6
7
|
opts = args.find { |a| a.is_a?(Hash) }
|
@@ -24,7 +25,7 @@ class Profiler
|
|
24
25
|
|
25
26
|
begin
|
26
27
|
yield
|
27
|
-
rescue => e
|
28
|
+
rescue StandardError => e
|
28
29
|
profile.stop
|
29
30
|
raise e
|
30
31
|
end
|
@@ -38,34 +39,34 @@ class Profiler
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
|
-
out
|
42
|
+
out
|
42
43
|
end
|
43
44
|
|
44
45
|
private
|
45
46
|
|
46
47
|
def out
|
47
|
-
File.open(File.join(@dir,
|
48
|
+
File.open(File.join(@dir, 'graph.html'), 'w') do |file|
|
48
49
|
RubyProf::GraphHtmlPrinter.new(@results).print(file)
|
49
50
|
end
|
50
51
|
|
51
|
-
File.open(File.join(@dir,
|
52
|
-
RubyProf::
|
52
|
+
File.open(File.join(@dir, 'flat.txt'), 'w') do |file|
|
53
|
+
RubyProf::FlatPrinter.new(@results).print(file)
|
53
54
|
end
|
54
55
|
|
55
|
-
File.open(File.join(@dir,
|
56
|
+
File.open(File.join(@dir, 'stack.html'), 'w') do |file|
|
56
57
|
RubyProf::CallStackPrinter.new(@results).print(file)
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
60
61
|
def exclusion_regex
|
61
|
-
|
62
|
-
|
62
|
+
root = '/lib/ruby/'
|
63
|
+
if config[:exclude_gems] && config[:exclude_standard_lib]
|
64
|
+
/#{root}/
|
63
65
|
elsif config[:exclude_gems]
|
64
|
-
|
66
|
+
%r{#{root}gems/}
|
65
67
|
elsif config[:exclude_standard_lib]
|
66
|
-
|
68
|
+
/#{root}[^g]/
|
67
69
|
end
|
68
70
|
end
|
69
|
-
|
70
71
|
end
|
71
72
|
end
|
data/lib/profiling/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profiling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Duncalfe
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,100 +16,100 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.10'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec_junit_formatter
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '0.9'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '0.9'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ruby-prof
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.4'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
111
|
-
description:
|
112
|
-
around the ruby-prof gem to do simple but powerful profiling
|
110
|
+
version: '1.4'
|
111
|
+
description: Non-discriminatory profiler for Ruby MRI code. This gem is a small wrapper
|
112
|
+
around the ruby-prof gem to do simple but powerful profiling
|
113
113
|
email:
|
114
114
|
- lduncalfe@eml.cc
|
115
115
|
executables: []
|
@@ -129,7 +129,7 @@ licenses:
|
|
129
129
|
- MIT
|
130
130
|
metadata:
|
131
131
|
yard.run: yri
|
132
|
-
post_install_message:
|
132
|
+
post_install_message:
|
133
133
|
rdoc_options: []
|
134
134
|
require_paths:
|
135
135
|
- lib
|
@@ -137,17 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
137
|
requirements:
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
140
|
+
version: 2.5.0
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
|
148
|
-
|
149
|
-
signing_key:
|
147
|
+
rubygems_version: 3.2.3
|
148
|
+
signing_key:
|
150
149
|
specification_version: 4
|
151
|
-
summary:
|
152
|
-
the ruby-prof gem to do simple but powerful profiling'
|
150
|
+
summary: Non-discriminatory profiler for Ruby MRI code.
|
153
151
|
test_files: []
|