trace_tree 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/trace_tree.rb +5 -0
- data/lib/trace_tree/version.rb +1 -1
- data/lib/trace_tree/warm.rb +20 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b40964e36895674c6e39e8b8dbb57cef034da914f3b1a6c59d5bc7cf0061abe3
|
4
|
+
data.tar.gz: c84f93c457c7f2481f49823cea6ace1b979e5728bfe84b1a03fbcf1b85b1187f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc7707c5c358b7304c7966d4cd96fde2b98049525e5906ca442a238cd5afa0fd8dac3aeaa2b14b64590e814f68556895bcf1f4b9470c69131ff4c9bdf2530a2b
|
7
|
+
data.tar.gz: 1b695fcf38a0cb76de637651e55802c4196dd1bed8ce0b31f3972317b8ed57155892984e04a784ff3ed9bd74f05d6881e9965d70a280facc9ea69a21e1497658
|
data/README.md
CHANGED
@@ -55,7 +55,8 @@ end
|
|
55
55
|
* `:return => true` by default. It stores return values of functions in generated html. Hover function call and press `r` to print return value in console.
|
56
56
|
* `:args => false` by default. Set it true to puts arguments of `:call` functions into html. Since arguments are always return values of other functions, so this option is not necessary.
|
57
57
|
* `:in => //, :out => nil` by default. Give them regexp(s) to include/exclude methods defined in files match that regexp(s). Notice thread-calls and methods defined by `define_method` are always included. Also, once you set any of these two options, the code to trace should not be in same line with `binding.trace_tree() do`.
|
58
|
-
* `:no_methods => nil` by
|
58
|
+
* `:no_methods => nil` by default. Give it regexp(s) to hide stack under matching methods. Useful when you want to dump stack of a rack middleware but lower middlewares.
|
59
|
+
* `:warm => nil` by default. Set it something unique to the code block so that the code block will be traced only when it's called second time, in case we dump lots of code loading and initialization.
|
59
60
|
* `:timer => nil` by default. Set it true if you want to know how much time spent in tracing and drawing tree. Notice the `file` should be appendable, otherwise the time will overwrite the tree.
|
60
61
|
* `:debug => nil` by default. Give it somthing like what for `:tmp` to output a whole list of TracePoints in file for debug.
|
61
62
|
|
data/lib/trace_tree.rb
CHANGED
@@ -8,11 +8,16 @@ require 'trace_tree/args'
|
|
8
8
|
require 'trace_tree/tmp_file'
|
9
9
|
require 'trace_tree/timer'
|
10
10
|
require 'trace_tree/config'
|
11
|
+
require 'trace_tree/warm'
|
11
12
|
require 'thread'
|
12
13
|
require 'terminal-tableofhashes'
|
13
14
|
|
14
15
|
class Binding
|
15
16
|
def trace_tree *log, **opt, &to_do
|
17
|
+
if (key = opt[:warm]) && !TraceTree::Warm.check_and_warm(key)
|
18
|
+
return yield
|
19
|
+
end
|
20
|
+
|
16
21
|
TraceTree.new(self).generate *log, **opt, &to_do
|
17
22
|
end
|
18
23
|
end
|
data/lib/trace_tree/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
3
|
+
class TraceTree
|
4
|
+
module Warm
|
5
|
+
|
6
|
+
Warmed = Set.new
|
7
|
+
Lock = Mutex.new
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def check_and_warm key
|
11
|
+
Lock.synchronize do
|
12
|
+
warmed = Warmed.include? key
|
13
|
+
Warmed << key unless warmed
|
14
|
+
warmed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/trace_tree/tree_graphable.rb
|
178
178
|
- lib/trace_tree/tree_htmlable.rb
|
179
179
|
- lib/trace_tree/version.rb
|
180
|
+
- lib/trace_tree/warm.rb
|
180
181
|
- trace_tree.gemspec
|
181
182
|
homepage: https://github.com/turnon/trace_tree
|
182
183
|
licenses:
|