rack-mini-profiler 0.9.6 → 0.9.7

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.

Potentially problematic release.


This version of rack-mini-profiler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e83bf4519ed83cd942b168c34783ee321a34e63f
4
- data.tar.gz: f53964ce3946d426cac21d760e49ee37cf5e0fea
3
+ metadata.gz: 2417d22f7d7896ced32bc242d3e7f0b43eb73f6f
4
+ data.tar.gz: 0a5d429ac232a90772dd17de9650fb12f6eb355c
5
5
  SHA512:
6
- metadata.gz: a2e447437d2fb8dc5872fe3d751ee535b0bdb0e6a6e35644b0627412b126ce80535571c63408a0845f71aa5afc3065ce75fc8482746dd7ba617e60d0a69efa05
7
- data.tar.gz: 81c35341c085d80ac5eee5b2423cdb8c6e3dbb9f9d3d08493ddb613b7349aa107dcffe4b7e5d54217066f54425269b29d65592519b35f84d1755411fc327ab0d
6
+ metadata.gz: 1b33304bb3ccb9e659fc5a274d939cb2e8455a9a5427bd3fa46a98ff8d88d5b238ebfe3a46f6b2cee9730f88a1ebe585bae41ac716f988e5feecc6ac17231d48
7
+ data.tar.gz: 8799e05e0fcea21ab023aa7e4594cb75e21c7315fa0c25478d275a3df815b37731cb490d3e64756d0bc2d206d00292b9c395a368349715c22cd7dbe328f2093b
@@ -1,14 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 0.9.6 - 2014-07-08 (Sam Saffron)
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 - 2014-07-08 (Sam Saffron)
13
+ ## 0.9.5 - 2015-07-08 (Sam Saffron)
8
14
 
9
15
  - [FEATURE] improve pp=analyze-memory
10
16
 
11
- ## 0.9.4 - 2014-07-08 (Sam Saffron)
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
- * backtrace_filter - a regex you can use to filter out unwanted lines from the backtraces
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
- if query_string =~ /pp=profile-gc-time/
204
- return Rack::MiniProfiler::GCProfiler.new.profile_gc_time(@app, env)
205
- elsif query_string =~ /pp=profile-gc-ruby-head/
206
- result = StringIO.new
207
- report = MemoryProfiler.report do
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-gc-time", env} : perform built-in gc profiling on this request (ruby 1.9.3 only)
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.
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MiniProfiler
3
- VERSION = '0.9.6'
3
+ VERSION = '0.9.7'
4
4
  end
5
5
  end
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.6
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-07-08 00:00:00.000000000 Z
13
+ date: 2015-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack