rack-mini-profiler 0.10.6 → 2.3.0

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.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +129 -16
  3. data/README.md +116 -63
  4. data/lib/enable_rails_patches.rb +5 -0
  5. data/lib/generators/rack_profiler/install_generator.rb +2 -0
  6. data/lib/generators/rack_profiler/templates/rack_profiler.rb +2 -0
  7. data/lib/html/dot.1.1.2.min.js +2 -0
  8. data/lib/html/includes.css +141 -40
  9. data/lib/html/includes.js +1398 -970
  10. data/lib/html/includes.scss +547 -442
  11. data/lib/html/includes.tmpl +227 -142
  12. data/lib/html/pretty-print.js +810 -0
  13. data/lib/html/profile_handler.js +1 -1
  14. data/lib/html/rack-mini-profiler.css +3 -0
  15. data/lib/html/rack-mini-profiler.js +2 -0
  16. data/lib/html/share.html +0 -1
  17. data/lib/html/speedscope/LICENSE +21 -0
  18. data/lib/html/speedscope/README.md +3 -0
  19. data/lib/html/speedscope/demangle-cpp.1768f4cc.js +4 -0
  20. data/lib/html/speedscope/favicon-16x16.f74b3187.png +0 -0
  21. data/lib/html/speedscope/favicon-32x32.bc503437.png +0 -0
  22. data/lib/html/speedscope/file-format-schema.json +324 -0
  23. data/lib/html/speedscope/import.cf0fa83f.js +115 -0
  24. data/lib/html/speedscope/index.html +2 -0
  25. data/lib/html/speedscope/release.txt +3 -0
  26. data/lib/html/speedscope/reset.8c46b7a1.css +2 -0
  27. data/lib/html/speedscope/source-map.438fa06b.js +24 -0
  28. data/lib/html/speedscope/speedscope.44364064.js +200 -0
  29. data/lib/html/vendor.js +848 -0
  30. data/lib/mini_profiler/asset_version.rb +3 -2
  31. data/lib/mini_profiler/client_settings.rb +27 -16
  32. data/lib/mini_profiler/config.rb +73 -46
  33. data/lib/mini_profiler/context.rb +5 -3
  34. data/lib/mini_profiler/gc_profiler.rb +17 -16
  35. data/lib/mini_profiler/profiler.rb +332 -94
  36. data/lib/mini_profiler/profiling_methods.rb +20 -15
  37. data/lib/mini_profiler/snapshots_transporter.rb +109 -0
  38. data/lib/mini_profiler/storage/abstract_store.rb +80 -0
  39. data/lib/mini_profiler/storage/file_store.rb +18 -13
  40. data/lib/mini_profiler/storage/memcache_store.rb +10 -7
  41. data/lib/mini_profiler/storage/memory_store.rb +63 -13
  42. data/lib/mini_profiler/storage/redis_store.rb +143 -7
  43. data/lib/mini_profiler/timer_struct/base.rb +4 -2
  44. data/lib/mini_profiler/timer_struct/client.rb +9 -8
  45. data/lib/mini_profiler/timer_struct/custom.rb +8 -5
  46. data/lib/mini_profiler/timer_struct/page.rb +79 -24
  47. data/lib/mini_profiler/timer_struct/request.rb +83 -38
  48. data/lib/mini_profiler/timer_struct/sql.rb +25 -22
  49. data/lib/mini_profiler/version.rb +3 -1
  50. data/lib/mini_profiler_rails/railtie.rb +91 -8
  51. data/lib/mini_profiler_rails/railtie_methods.rb +61 -0
  52. data/lib/patches/db/activerecord.rb +5 -14
  53. data/lib/patches/db/mongo.rb +3 -1
  54. data/lib/patches/db/moped.rb +5 -3
  55. data/lib/patches/db/mysql2.rb +8 -6
  56. data/lib/patches/db/neo4j.rb +3 -1
  57. data/lib/patches/db/nobrainer.rb +4 -2
  58. data/lib/patches/db/oracle_enhanced.rb +4 -2
  59. data/lib/patches/db/pg.rb +41 -21
  60. data/lib/patches/db/plucky.rb +7 -5
  61. data/lib/patches/db/riak.rb +15 -13
  62. data/lib/patches/db/rsolr.rb +6 -4
  63. data/lib/patches/db/sequel.rb +2 -0
  64. data/lib/patches/net_patches.rb +20 -8
  65. data/lib/patches/sql_patches.rb +17 -7
  66. data/lib/prepend_net_http_patch.rb +5 -0
  67. data/lib/rack-mini-profiler.rb +3 -3
  68. data/rack-mini-profiler.gemspec +23 -9
  69. metadata +146 -31
  70. data/lib/html/jquery.1.7.1.js +0 -4
  71. data/lib/html/jquery.tmpl.js +0 -486
  72. data/lib/html/list.css +0 -9
  73. data/lib/html/list.js +0 -38
  74. data/lib/html/list.tmpl +0 -34
@@ -1,9 +1,40 @@
1
1
  @charset "UTF-8";
2
- .profiler-result, .profiler-queries {
2
+ .mp-snapshots,
3
+ .profiler-result,
4
+ .profiler-queries {
3
5
  color: #555;
4
6
  line-height: 1;
5
7
  font-size: 12px; }
6
- .profiler-result pre, .profiler-result code, .profiler-result label, .profiler-result table, .profiler-result tbody, .profiler-result thead, .profiler-result tfoot, .profiler-result tr, .profiler-result th, .profiler-result td, .profiler-queries pre, .profiler-queries code, .profiler-queries label, .profiler-queries table, .profiler-queries tbody, .profiler-queries thead, .profiler-queries tfoot, .profiler-queries tr, .profiler-queries th, .profiler-queries td {
8
+ .mp-snapshots pre,
9
+ .mp-snapshots code,
10
+ .mp-snapshots label,
11
+ .mp-snapshots table,
12
+ .mp-snapshots tbody,
13
+ .mp-snapshots thead,
14
+ .mp-snapshots tfoot,
15
+ .mp-snapshots tr,
16
+ .mp-snapshots th,
17
+ .mp-snapshots td,
18
+ .profiler-result pre,
19
+ .profiler-result code,
20
+ .profiler-result label,
21
+ .profiler-result table,
22
+ .profiler-result tbody,
23
+ .profiler-result thead,
24
+ .profiler-result tfoot,
25
+ .profiler-result tr,
26
+ .profiler-result th,
27
+ .profiler-result td,
28
+ .profiler-queries pre,
29
+ .profiler-queries code,
30
+ .profiler-queries label,
31
+ .profiler-queries table,
32
+ .profiler-queries tbody,
33
+ .profiler-queries thead,
34
+ .profiler-queries tfoot,
35
+ .profiler-queries tr,
36
+ .profiler-queries th,
37
+ .profiler-queries td {
7
38
  margin: 0;
8
39
  padding: 0;
9
40
  border: 0;
@@ -13,21 +44,40 @@
13
44
  background-color: transparent;
14
45
  overflow: visible;
15
46
  max-height: none; }
16
- .profiler-result table, .profiler-queries table {
47
+ .mp-snapshots table,
48
+ .profiler-result table,
49
+ .profiler-queries table {
17
50
  border-collapse: collapse;
18
51
  border-spacing: 0; }
19
- .profiler-result a, .profiler-result a:hover, .profiler-queries a, .profiler-queries a:hover {
52
+ .mp-snapshots a,
53
+ .mp-snapshots a:hover,
54
+ .profiler-result a,
55
+ .profiler-result a:hover,
56
+ .profiler-queries a,
57
+ .profiler-queries a:hover {
20
58
  cursor: pointer;
21
- color: #0077CC; }
22
- .profiler-result a, .profiler-queries a {
59
+ color: #0077cc; }
60
+ .mp-snapshots a,
61
+ .profiler-result a,
62
+ .profiler-queries a {
23
63
  text-decoration: none; }
24
- .profiler-result a:hover, .profiler-queries a:hover {
64
+ .mp-snapshots a:hover,
65
+ .profiler-result a:hover,
66
+ .profiler-queries a:hover {
25
67
  text-decoration: underline; }
68
+ .mp-snapshots .custom-fields-title,
69
+ .profiler-result .custom-fields-title,
70
+ .profiler-queries .custom-fields-title {
71
+ color: #555;
72
+ font: Helvetica, Arial, sans-serif;
73
+ font-size: 14px; }
26
74
 
27
75
  .profiler-result {
28
76
  font-family: Helvetica, Arial, sans-serif; }
29
77
  .profiler-result .profiler-toggle-duration-with-children {
30
78
  float: right; }
79
+ .profiler-result .profiler-snapshots-page-link {
80
+ float: left; }
31
81
  .profiler-result table.profiler-client-timings {
32
82
  margin-top: 10px; }
33
83
  .profiler-result .profiler-label {
@@ -35,12 +85,16 @@
35
85
  overflow: hidden;
36
86
  text-overflow: ellipsis; }
37
87
  .profiler-result .profiler-unit {
38
- color: #aaa; }
88
+ color: #767676; }
39
89
  .profiler-result .profiler-trivial {
40
90
  display: none; }
41
- .profiler-result .profiler-trivial td, .profiler-result .profiler-trivial td * {
42
- color: #aaa !important; }
43
- .profiler-result pre, .profiler-result code, .profiler-result .profiler-number, .profiler-result .profiler-unit {
91
+ .profiler-result .profiler-trivial td,
92
+ .profiler-result .profiler-trivial td * {
93
+ color: #767676 !important; }
94
+ .profiler-result pre,
95
+ .profiler-result code,
96
+ .profiler-result .profiler-number,
97
+ .profiler-result .profiler-unit {
44
98
  font-family: Consolas, monospace, serif; }
45
99
  .profiler-result .profiler-number {
46
100
  color: #111; }
@@ -52,9 +106,10 @@
52
106
  white-space: nowrap; }
53
107
  .profiler-result .profiler-timings th {
54
108
  background-color: #fff;
55
- color: #aaa;
109
+ color: #767676;
56
110
  text-align: right; }
57
- .profiler-result .profiler-timings th, .profiler-result .profiler-timings td {
111
+ .profiler-result .profiler-timings th,
112
+ .profiler-result .profiler-timings td {
58
113
  white-space: nowrap; }
59
114
  .profiler-result .profiler-timings .profiler-duration-with-children {
60
115
  display: none; }
@@ -63,8 +118,9 @@
63
118
  text-align: right; }
64
119
  .profiler-result .profiler-timings .profiler-indent {
65
120
  letter-spacing: 4px; }
66
- .profiler-result .profiler-timings .profiler-queries-show .profiler-number, .profiler-result .profiler-timings .profiler-queries-show .profiler-unit {
67
- color: #0077CC; }
121
+ .profiler-result .profiler-timings .profiler-queries-show .profiler-number,
122
+ .profiler-result .profiler-timings .profiler-queries-show .profiler-unit {
123
+ color: #0077cc; }
68
124
  .profiler-result .profiler-timings .profiler-queries-duration {
69
125
  padding-left: 6px; }
70
126
  .profiler-result .profiler-timings .profiler-percent-in-sql {
@@ -89,13 +145,15 @@
89
145
  .profiler-result .profiler-queries tbody tr {
90
146
  border-bottom: 1px solid #f1f1f1; }
91
147
  .profiler-result .profiler-queries tr {
92
- background-color: #FFF; }
148
+ background-color: #fff; }
149
+ .profiler-result .profiler-queries tr.higlight-animate {
150
+ animation: highlight-in 3s; }
93
151
  .profiler-result .profiler-queries tr.slow {
94
- background-color: #FEE; }
152
+ background-color: #fee; }
95
153
  .profiler-result .profiler-queries tr.very-slow {
96
- background-color: #FDD; }
154
+ background-color: #fdd; }
97
155
  .profiler-result .profiler-queries tr.very-very-slow {
98
- background-color: #FCC; }
156
+ background-color: #fcc; }
99
157
  .profiler-result .profiler-queries pre {
100
158
  font-family: Consolas, monospace, serif;
101
159
  white-space: pre-wrap; }
@@ -110,12 +168,14 @@
110
168
  text-align: left; }
111
169
  .profiler-result .profiler-queries td:last-child {
112
170
  padding-right: 25px; }
113
- .profiler-result .profiler-queries .profiler-since-start, .profiler-result .profiler-queries .profiler-duration {
171
+ .profiler-result .profiler-queries .profiler-since-start,
172
+ .profiler-result .profiler-queries .profiler-duration {
114
173
  text-align: right; }
115
174
  .profiler-result .profiler-queries .profiler-info div {
116
175
  text-align: right;
117
176
  margin-bottom: 5px; }
118
- .profiler-result .profiler-queries .profiler-gap-info, .profiler-result .profiler-queries .profiler-gap-info td {
177
+ .profiler-result .profiler-queries .profiler-gap-info,
178
+ .profiler-result .profiler-queries .profiler-gap-info td {
119
179
  background-color: #ccc; }
120
180
  .profiler-result .profiler-queries .profiler-gap-info .profiler-unit {
121
181
  color: #777; }
@@ -147,9 +207,15 @@
147
207
  color: blue; }
148
208
  .profiler-result .profiler-queries .dec {
149
209
  color: purple; }
150
- .profiler-result .profiler-warning, .profiler-result .profiler-warning *, .profiler-result .profiler-warning .profiler-queries-show, .profiler-result .profiler-warning .profiler-queries-show .profiler-unit {
210
+ .profiler-result .profiler-warning,
211
+ .profiler-result .profiler-warning *,
212
+ .profiler-result .profiler-warning .profiler-queries-show,
213
+ .profiler-result .profiler-warning .profiler-queries-show .profiler-unit {
151
214
  color: #f00; }
152
- .profiler-result .profiler-warning:hover, .profiler-result .profiler-warning *:hover, .profiler-result .profiler-warning .profiler-queries-show:hover, .profiler-result .profiler-warning .profiler-queries-show .profiler-unit:hover {
215
+ .profiler-result .profiler-warning:hover,
216
+ .profiler-result .profiler-warning *:hover,
217
+ .profiler-result .profiler-warning .profiler-queries-show:hover,
218
+ .profiler-result .profiler-warning .profiler-queries-show .profiler-unit:hover {
153
219
  color: #f00; }
154
220
  .profiler-result .profiler-nuclear {
155
221
  color: #f00;
@@ -165,39 +231,48 @@
165
231
  top: 0px; }
166
232
  .profiler-results.profiler-top.profiler-left {
167
233
  left: 0px; }
168
- .profiler-results.profiler-top.profiler-left.profiler-no-controls .profiler-totals, .profiler-results.profiler-top.profiler-left.profiler-no-controls .profiler-result:last-child .profiler-button, .profiler-results.profiler-top.profiler-left .profiler-controls {
234
+ .profiler-results.profiler-top.profiler-left.profiler-no-controls .profiler-totals, .profiler-results.profiler-top.profiler-left.profiler-no-controls .profiler-result:last-child .profiler-button,
235
+ .profiler-results.profiler-top.profiler-left .profiler-controls {
169
236
  -webkit-border-bottom-right-radius: 10px;
170
237
  -moz-border-radius-bottomright: 10px;
171
238
  border-bottom-right-radius: 10px; }
172
- .profiler-results.profiler-top.profiler-left .profiler-button, .profiler-results.profiler-top.profiler-left .profiler-controls {
239
+ .profiler-results.profiler-top.profiler-left .profiler-button,
240
+ .profiler-results.profiler-top.profiler-left .profiler-controls {
173
241
  border-right: 1px solid #888; }
174
242
  .profiler-results.profiler-top.profiler-right {
175
243
  right: 0px; }
176
- .profiler-results.profiler-top.profiler-right.profiler-no-controls .profiler-totals, .profiler-results.profiler-top.profiler-right.profiler-no-controls .profiler-result:last-child .profiler-button, .profiler-results.profiler-top.profiler-right .profiler-controls {
244
+ .profiler-results.profiler-top.profiler-right.profiler-no-controls .profiler-totals, .profiler-results.profiler-top.profiler-right.profiler-no-controls .profiler-result:last-child .profiler-button,
245
+ .profiler-results.profiler-top.profiler-right .profiler-controls {
177
246
  -webkit-border-bottom-left-radius: 10px;
178
247
  -moz-border-radius-bottomleft: 10px;
179
248
  border-bottom-left-radius: 10px; }
180
- .profiler-results.profiler-top.profiler-right .profiler-button, .profiler-results.profiler-top.profiler-right .profiler-controls {
249
+ .profiler-results.profiler-top.profiler-right .profiler-button,
250
+ .profiler-results.profiler-top.profiler-right .profiler-controls {
181
251
  border-left: 1px solid #888; }
182
252
  .profiler-results.profiler-bottom {
183
253
  bottom: 0px; }
184
254
  .profiler-results.profiler-bottom.profiler-left {
185
255
  left: 0px; }
186
- .profiler-results.profiler-bottom.profiler-left.profiler-no-controls .profiler-totals, .profiler-results.profiler-bottom.profiler-left.profiler-no-controls .profiler-result:first-child .profiler-button, .profiler-results.profiler-bottom.profiler-left .profiler-controls {
256
+ .profiler-results.profiler-bottom.profiler-left.profiler-no-controls .profiler-totals, .profiler-results.profiler-bottom.profiler-left.profiler-no-controls .profiler-result:first-child .profiler-button,
257
+ .profiler-results.profiler-bottom.profiler-left .profiler-controls {
187
258
  -webkit-border-top-right-radius: 10px;
188
259
  -moz-border-radius-topright: 10px;
189
260
  border-top-right-radius: 10px; }
190
- .profiler-results.profiler-bottom.profiler-left .profiler-button, .profiler-results.profiler-bottom.profiler-left .profiler-controls {
261
+ .profiler-results.profiler-bottom.profiler-left .profiler-button,
262
+ .profiler-results.profiler-bottom.profiler-left .profiler-controls {
191
263
  border-right: 1px solid #888; }
192
264
  .profiler-results.profiler-bottom.profiler-right {
193
265
  right: 0px; }
194
- .profiler-results.profiler-bottom.profiler-right.profiler-no-controls .profiler-totals, .profiler-results.profiler-bottom.profiler-right.profiler-no-controls .profiler-result:first-child .profiler-button, .profiler-results.profiler-bottom.profiler-right .profiler-controls {
266
+ .profiler-results.profiler-bottom.profiler-right.profiler-no-controls .profiler-totals, .profiler-results.profiler-bottom.profiler-right.profiler-no-controls .profiler-result:first-child .profiler-button,
267
+ .profiler-results.profiler-bottom.profiler-right .profiler-controls {
195
268
  -webkit-border-bottom-top-radius: 10px;
196
269
  -moz-border-radius-topleft: 10px;
197
270
  border-top-left-radius: 10px; }
198
- .profiler-results.profiler-bottom.profiler-right .profiler-button, .profiler-results.profiler-bottom.profiler-right .profiler-controls {
271
+ .profiler-results.profiler-bottom.profiler-right .profiler-button,
272
+ .profiler-results.profiler-bottom.profiler-right .profiler-controls {
199
273
  border-left: 1px solid #888; }
200
- .profiler-results .profiler-button, .profiler-results .profiler-controls {
274
+ .profiler-results .profiler-button,
275
+ .profiler-results .profiler-controls {
201
276
  display: none;
202
277
  z-index: 2147483640;
203
278
  border-bottom: 1px solid #888;
@@ -205,12 +280,17 @@
205
280
  padding: 4px 7px;
206
281
  text-align: right;
207
282
  cursor: pointer; }
208
- .profiler-results .profiler-button.profiler-button-active, .profiler-results .profiler-controls.profiler-button-active {
283
+ .profiler-results .profiler-button.profiler-button-active,
284
+ .profiler-results .profiler-controls.profiler-button-active {
209
285
  background-color: maroon; }
210
- .profiler-results .profiler-button.profiler-button-active .profiler-number, .profiler-results .profiler-button.profiler-button-active .profiler-nuclear, .profiler-results .profiler-controls.profiler-button-active .profiler-number, .profiler-results .profiler-controls.profiler-button-active .profiler-nuclear {
286
+ .profiler-results .profiler-button.profiler-button-active .profiler-number,
287
+ .profiler-results .profiler-button.profiler-button-active .profiler-nuclear,
288
+ .profiler-results .profiler-controls.profiler-button-active .profiler-number,
289
+ .profiler-results .profiler-controls.profiler-button-active .profiler-nuclear {
211
290
  color: #fff;
212
291
  font-weight: bold; }
213
- .profiler-results .profiler-button.profiler-button-active .profiler-unit, .profiler-results .profiler-controls.profiler-button-active .profiler-unit {
292
+ .profiler-results .profiler-button.profiler-button-active .profiler-unit,
293
+ .profiler-results .profiler-controls.profiler-button-active .profiler-unit {
214
294
  color: #fff;
215
295
  font-weight: normal; }
216
296
  .profiler-results .profiler-totals .profiler-reqs {
@@ -228,7 +308,7 @@
228
308
  cursor: default;
229
309
  text-align: center; }
230
310
  .profiler-results .profiler-controls span {
231
- border-right: 1px solid #aaa;
311
+ border-right: 1px solid #767676;
232
312
  padding-right: 5px;
233
313
  margin-right: 5px;
234
314
  cursor: pointer; }
@@ -258,7 +338,8 @@
258
338
  display: none; }
259
339
  .profiler-results .profiler-popup .profiler-info .profiler-server-time {
260
340
  font-size: 95%; }
261
- .profiler-results .profiler-popup .profiler-timings th, .profiler-results .profiler-popup .profiler-timings td {
341
+ .profiler-results .profiler-popup .profiler-timings th,
342
+ .profiler-results .profiler-popup .profiler-timings td {
262
343
  padding-left: 6px;
263
344
  padding-right: 6px; }
264
345
  .profiler-results .profiler-popup .profiler-timings th {
@@ -288,7 +369,6 @@
288
369
  @media print {
289
370
  .profiler-results {
290
371
  display: none; } }
291
-
292
372
  .profiler-queries-bg {
293
373
  z-index: 2147483642;
294
374
  display: none;
@@ -306,14 +386,15 @@
306
386
  display: none; }
307
387
  .profiler-result-full .profiler-result .profiler-popup .profiler-info {
308
388
  font-size: 25px;
309
- border-bottom: 1px solid #aaa;
389
+ border-bottom: 1px solid #767676;
310
390
  padding-bottom: 3px;
311
391
  margin-bottom: 25px; }
312
392
  .profiler-result-full .profiler-result .profiler-popup .profiler-info .profiler-overall-duration {
313
393
  padding-right: 20px;
314
394
  font-size: 80%;
315
395
  color: #888; }
316
- .profiler-result-full .profiler-result .profiler-popup .profiler-timings td, .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
396
+ .profiler-result-full .profiler-result .profiler-popup .profiler-timings td,
397
+ .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
317
398
  padding-left: 8px;
318
399
  padding-right: 8px; }
319
400
  .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
@@ -339,3 +420,23 @@
339
420
  .profiler-result-full .profiler-result .profiler-queries .profiler-info div {
340
421
  text-align: right;
341
422
  margin-bottom: 5px; }
423
+
424
+ @keyframes highlight-in {
425
+ 0% {
426
+ background: #ffffbb; }
427
+ 100% {
428
+ background: #fff; } }
429
+
430
+ .mp-snapshots {
431
+ font-family: Helvetica, Arial, sans-serif;
432
+ font-size: 16px; }
433
+ .mp-snapshots .snapshots-table thead {
434
+ background: #6a737c;
435
+ color: #ffffff; }
436
+ .mp-snapshots .snapshots-table th, .mp-snapshots .snapshots-table td {
437
+ padding: 5px 10px;
438
+ box-sizing: border-box; }
439
+ .mp-snapshots .snapshots-table th:not(.request-group), .mp-snapshots .snapshots-table td:not(.request-group) {
440
+ text-align: center; }
441
+ .mp-snapshots .snapshots-table th {
442
+ border-right: 1px solid #ffffff; }