rack-mini-profiler 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack-mini-profiler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -3
- data/README.md +4 -2
- data/lib/mini_profiler/gc_profiler.rb +0 -20
- data/lib/mini_profiler/profiler.rb +12 -16
- data/lib/mini_profiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2417d22f7d7896ced32bc242d3e7f0b43eb73f6f
|
4
|
+
data.tar.gz: 0a5d429ac232a90772dd17de9650fb12f6eb355c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b33304bb3ccb9e659fc5a274d939cb2e8455a9a5427bd3fa46a98ff8d88d5b238ebfe3a46f6b2cee9730f88a1ebe585bae41ac716f988e5feecc6ac17231d48
|
7
|
+
data.tar.gz: 8799e05e0fcea21ab023aa7e4594cb75e21c7315fa0c25478d275a3df815b37731cb490d3e64756d0bc2d206d00292b9c395a368349715c22cd7dbe328f2093b
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## 0.9.
|
3
|
+
## 0.9.7 - 2015-08-03 (Sam Saffron)
|
4
|
+
|
5
|
+
- [FEATURE] remove confusing pp=profile-gc-time (Nate Berkopec)
|
6
|
+
- [FEATURE] truncate strings in pp=analyze-memory (Nate Berkopec)
|
7
|
+
- [FEATURE] rename pp=profile-gc-ruby-head to pp=profile-memory (Nate Berkopec)
|
8
|
+
|
9
|
+
## 0.9.6 - 2015-07-08 (Sam Saffron)
|
4
10
|
|
5
11
|
- [FIX] incorrect truncation in pp=analyze-memory
|
6
12
|
|
7
|
-
## 0.9.5 -
|
13
|
+
## 0.9.5 - 2015-07-08 (Sam Saffron)
|
8
14
|
|
9
15
|
- [FEATURE] improve pp=analyze-memory
|
10
16
|
|
11
|
-
## 0.9.4 -
|
17
|
+
## 0.9.4 - 2015-07-08 (Sam Saffron)
|
12
18
|
- [UX] added a link to "more" actions in profiler
|
13
19
|
- [FEATURE] pp=help now displays links
|
14
20
|
- [FEATURE] simple memory report with pp=analyze-memory
|
data/README.md
CHANGED
@@ -121,7 +121,7 @@ To disable this behavior, use the following config setting:
|
|
121
121
|
|
122
122
|
```ruby
|
123
123
|
# Do not let rack-mini-profiler disable caching
|
124
|
-
Rack::MiniProfiler.config.disable_caching = false # defaults to true
|
124
|
+
Rack::MiniProfiler.config.disable_caching = false # defaults to true
|
125
125
|
```
|
126
126
|
|
127
127
|
### Storage
|
@@ -182,7 +182,9 @@ The available configuration options are:
|
|
182
182
|
* skip_paths - Specifies path list that can be skipped.
|
183
183
|
* skip_schema_queries - Whether or not you want to log the queries about the schema of your tables. Default is 'false', 'true' in rails development.
|
184
184
|
* auto_inject (default true) - when false the miniprofiler script is not injected in the page
|
185
|
-
*
|
185
|
+
* backtrace_ignores (default nil) - an array of regexes you can use to filter out unwanted lines from the backtraces
|
186
|
+
* backtrace_includes (default nil, or [/^\/?(app|config|lib|test)/] in rails) - an array of regexes you can use to keep lines in the backtrace
|
187
|
+
* backtrace_remove (default nil, or Rails.root in rails) - A string or regex to remove part of each line in the backtrace
|
186
188
|
* toggle_shortcut (default Alt+P) - a jquery.hotkeys.js-style keyboard shortcut, used to toggle the mini_profiler's visibility. See https://github.com/jeresig/jquery.hotkeys for more info.
|
187
189
|
* start_hidden (default false) - Whether or not you want the mini_profiler to be visible when loading a page
|
188
190
|
* backtrace_threshold_ms (default zero) - Minimum SQL query elapsed time before a backtrace is recorded. Backtrace recording can take a couple of milliseconds on rubies earlier than 2.0, impacting performance for very small queries.
|
@@ -92,26 +92,6 @@ class Rack::MiniProfiler::GCProfiler
|
|
92
92
|
[objects,memory_allocated]
|
93
93
|
end
|
94
94
|
|
95
|
-
def profile_gc_time(app, env)
|
96
|
-
body = []
|
97
|
-
|
98
|
-
begin
|
99
|
-
GC::Profiler.clear
|
100
|
-
prev_profiler_state = GC::Profiler.enabled?
|
101
|
-
prev_gc_state = GC.enable
|
102
|
-
GC::Profiler.enable
|
103
|
-
b = app.call(env)[2]
|
104
|
-
b.close if b.respond_to? :close
|
105
|
-
body << "GC Profiler ran during this request, if it fired you will see the cost below:\n\n"
|
106
|
-
body << GC::Profiler.result
|
107
|
-
ensure
|
108
|
-
prev_gc_state ? GC.disable : GC.enable
|
109
|
-
GC::Profiler.disable unless prev_profiler_state
|
110
|
-
end
|
111
|
-
|
112
|
-
return [200, {'Content-Type' => 'text/plain'}, body]
|
113
|
-
end
|
114
|
-
|
115
95
|
def profile_gc(app, env)
|
116
96
|
|
117
97
|
# for memsize_of
|
@@ -199,20 +199,17 @@ module Rack
|
|
199
199
|
|
200
200
|
if query_string =~ /pp=profile-gc/
|
201
201
|
current.measure = false if current
|
202
|
+
return Rack::MiniProfiler::GCProfiler.new.profile_gc(@app, env)
|
203
|
+
end
|
202
204
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
_,_,body = @app.call(env)
|
209
|
-
body.close if body.respond_to? :close
|
210
|
-
end
|
211
|
-
report.pretty_print(result)
|
212
|
-
return text_result(result.string)
|
213
|
-
else
|
214
|
-
return Rack::MiniProfiler::GCProfiler.new.profile_gc(@app, env)
|
205
|
+
if query_string =~ /pp=profile-memory/
|
206
|
+
result = StringIO.new
|
207
|
+
report = MemoryProfiler.report do
|
208
|
+
_,_,body = @app.call(env)
|
209
|
+
body.close if body.respond_to? :close
|
215
210
|
end
|
211
|
+
report.pretty_print(result)
|
212
|
+
return text_result(result.string)
|
216
213
|
end
|
217
214
|
|
218
215
|
MiniProfiler.create_current(env, @config)
|
@@ -515,10 +512,10 @@ module Rack
|
|
515
512
|
trim_strings(strings, max_size)
|
516
513
|
|
517
514
|
body << "\n\n\n1000 Largest strings:\n\n"
|
518
|
-
body << strings.map{|s,len| "#{s}\n(len: #{len})\n\n"}.join("\n")
|
515
|
+
body << strings.map{|s,len| "#{s[0..1000]}\n(len: #{len})\n\n"}.join("\n")
|
519
516
|
|
520
517
|
body << "\n\n\n1000 Sample strings:\n\n"
|
521
|
-
body << sample_strings.map{|s,len| "#{s}\n(len: #{len})\n\n"}.join("\n")
|
518
|
+
body << sample_strings.map{|s,len| "#{s[0..1000]}\n(len: #{len})\n\n"}.join("\n")
|
522
519
|
|
523
520
|
body << "\n\n\n1000 Most common strings:\n\n"
|
524
521
|
body << string_counts.sort{|a,b| b[1] <=> a[1]}[0..max_size].map{|s,len| "#{trunc.call(s)}\n(x #{len})\n\n"}.join("\n")
|
@@ -551,8 +548,7 @@ Append the following to your query string:
|
|
551
548
|
#{make_link "disable", env} : disable profiling for this session
|
552
549
|
#{make_link "enable", env} : enable profiling for this session (if previously disabled)
|
553
550
|
#{make_link "profile-gc", env} : perform gc profiling on this request, analyzes ObjectSpace generated by request (ruby 1.9.3 only)
|
554
|
-
#{make_link "profile-
|
555
|
-
#{make_link "profile-gc-ruby-head", env} : requires the memory_profiler gem, new location based report
|
551
|
+
#{make_link "profile-memory", env} : requires the memory_profiler gem, new location based report
|
556
552
|
#{make_link "flamegraph", env} : works best on Ruby 2.0, a graph representing sampled activity (requires the flamegraph gem).
|
557
553
|
#{make_link "flamegraph&flamegraph_sample_rate=1", env}: creates a flamegraph with the specified sample rate (in ms). Overrides value set in config
|
558
554
|
#{make_link "flamegraph_embed", env} : works best on Ruby 2.0, a graph representing sampled activity (requires the flamegraph gem), embedded resources for use on an intranet.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mini-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|