hotch 0.5.0 → 0.5.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 +5 -5
- data/LICENSE.txt +1 -0
- data/hotch.gemspec +3 -3
- data/lib/hotch.rb +10 -2
- data/lib/hotch/memory.rb +9 -4
- data/lib/hotch/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 81c6b6c4a7de4bfbb45eb8d4c4bef3672231aa8c9677329f81bf47dc3cf06e3d
|
4
|
+
data.tar.gz: 9ca8707942ea5d222891429764cb090d653cbccbd02f68c6d54ce47716611c6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70c13dc3481dbbf1fb7fe37e7828ae5f1a4c7913b8d15a0df0bbb20866eb3d71a464fcfad09e9eebb3ef66a456646961e91fba3ccfe34fd546e8f2c87eb85dff
|
7
|
+
data.tar.gz: 02506de0b9435c1bfca28ab740171d5118820965f7b7e40bfd504622defaaa7088e3f53f9da774e466d3d7fc13629092189c4f425db84d97365cc494898acc70
|
data/LICENSE.txt
CHANGED
data/hotch.gemspec
CHANGED
@@ -6,10 +6,10 @@ require 'hotch/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "hotch"
|
8
8
|
spec.version = Hotch::VERSION
|
9
|
-
spec.authors = ["Peter
|
10
|
-
spec.email = ["peter@
|
9
|
+
spec.authors = ["Peter Leitzen"]
|
10
|
+
spec.email = ["peter@leitzen.de"]
|
11
11
|
spec.summary = %q{Profile helper}
|
12
|
-
spec.description = %q{
|
12
|
+
spec.description = %q{Callstack and memory profiler}
|
13
13
|
spec.homepage = "https://github.com/splattael/hotch"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/hotch.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'stackprof'
|
2
2
|
require 'tmpdir'
|
3
3
|
|
4
|
+
require 'hotch/version'
|
5
|
+
|
4
6
|
class Hotch
|
5
7
|
attr_reader :name, :viewer, :filter, :options
|
6
8
|
|
@@ -44,7 +46,13 @@ class Hotch
|
|
44
46
|
dot = report_dot(report, dir, "profile.dot")
|
45
47
|
svg = convert_svg(dir, dot, "profile.svg")
|
46
48
|
|
47
|
-
|
49
|
+
@reports.clear
|
50
|
+
|
51
|
+
if block_given?
|
52
|
+
yield report, svg
|
53
|
+
else
|
54
|
+
return report, svg
|
55
|
+
end
|
48
56
|
end
|
49
57
|
|
50
58
|
def report_at_exit
|
@@ -53,7 +61,7 @@ class Hotch
|
|
53
61
|
at_exit do
|
54
62
|
stop
|
55
63
|
|
56
|
-
report do |svg|
|
64
|
+
report do |_, svg|
|
57
65
|
if viewer
|
58
66
|
puts "Profile SVG: #{svg}"
|
59
67
|
Kernel.system viewer, svg
|
data/lib/hotch/memory.rb
CHANGED
@@ -53,9 +53,14 @@ class Hotch
|
|
53
53
|
|
54
54
|
def report
|
55
55
|
# TODO make it persistent (as CSV)
|
56
|
-
report = @reports.inject(
|
57
|
-
yield report
|
56
|
+
report = @reports.inject(:+)
|
58
57
|
@reports.clear
|
58
|
+
|
59
|
+
if block_given?
|
60
|
+
yield report
|
61
|
+
else
|
62
|
+
report
|
63
|
+
end
|
59
64
|
end
|
60
65
|
|
61
66
|
def report_at_exit
|
@@ -88,7 +93,7 @@ class Hotch
|
|
88
93
|
end.compact
|
89
94
|
end
|
90
95
|
|
91
|
-
def
|
96
|
+
def +(other)
|
92
97
|
by_key = Hash[@lines.map { |line| [line.key, line] }]
|
93
98
|
other.lines.each do |line|
|
94
99
|
if existing = by_key[line.key]
|
@@ -144,7 +149,7 @@ class Hotch
|
|
144
149
|
def self.from_result(result, ignore_paths)
|
145
150
|
path, line, *args = result.flatten(1)
|
146
151
|
return if ignore_paths.any? { |ip| ip == path || ip === path }
|
147
|
-
filename = "#{strip_path(path)}:#{line}"
|
152
|
+
filename = "#{strip_path(path || "?")}:#{line}"
|
148
153
|
new(filename, *args)
|
149
154
|
end
|
150
155
|
|
data/lib/hotch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Peter
|
7
|
+
- Peter Leitzen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stackprof
|
@@ -66,9 +66,9 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.0'
|
69
|
-
description:
|
69
|
+
description: Callstack and memory profiler
|
70
70
|
email:
|
71
|
-
- peter@
|
71
|
+
- peter@leitzen.de
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.7.7
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Profile helper
|