rack-mini-profiler 1.0.2 → 3.1.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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +145 -21
  3. data/README.md +201 -94
  4. data/lib/enable_rails_patches.rb +5 -0
  5. data/lib/generators/rack_mini_profiler/USAGE +9 -0
  6. data/lib/generators/rack_mini_profiler/install_generator.rb +13 -0
  7. data/lib/generators/{rack_profiler/templates/rack_profiler.rb → rack_mini_profiler/templates/rack_mini_profiler.rb} +1 -1
  8. data/lib/generators/rack_profiler/install_generator.rb +6 -3
  9. data/lib/html/dot.1.1.2.min.js +2 -0
  10. data/lib/html/includes.css +144 -45
  11. data/lib/html/includes.js +1420 -1009
  12. data/lib/html/includes.scss +538 -441
  13. data/lib/html/includes.tmpl +231 -148
  14. data/lib/html/pretty-print.js +810 -0
  15. data/lib/html/profile_handler.js +1 -1
  16. data/lib/html/rack-mini-profiler.css +3 -0
  17. data/lib/html/rack-mini-profiler.js +2 -0
  18. data/lib/html/share.html +0 -1
  19. data/lib/html/speedscope/LICENSE +21 -0
  20. data/lib/html/speedscope/README.md +3 -0
  21. data/lib/html/speedscope/demangle-cpp.1768f4cc.js +4 -0
  22. data/lib/html/speedscope/favicon-16x16.f74b3187.png +0 -0
  23. data/lib/html/speedscope/favicon-32x32.bc503437.png +0 -0
  24. data/lib/html/speedscope/file-format-schema.json +324 -0
  25. data/lib/html/speedscope/fonts/source-code-pro-regular.css +8 -0
  26. data/lib/html/speedscope/fonts/source-code-pro-v13-regular.woff +0 -0
  27. data/lib/html/speedscope/fonts/source-code-pro-v13-regular.woff2 +0 -0
  28. data/lib/html/speedscope/import.cf0fa83f.js +115 -0
  29. data/lib/html/speedscope/index.html +2 -0
  30. data/lib/html/speedscope/release.txt +3 -0
  31. data/lib/html/speedscope/reset.8c46b7a1.css +2 -0
  32. data/lib/html/speedscope/source-map.438fa06b.js +24 -0
  33. data/lib/html/speedscope/speedscope.44364064.js +200 -0
  34. data/lib/html/vendor.js +848 -0
  35. data/lib/mini_profiler/asset_version.rb +3 -2
  36. data/lib/mini_profiler/client_settings.rb +15 -7
  37. data/lib/mini_profiler/config.rb +51 -5
  38. data/lib/mini_profiler/gc_profiler.rb +1 -1
  39. data/lib/mini_profiler/profiling_methods.rb +13 -8
  40. data/lib/mini_profiler/snapshots_transporter.rb +109 -0
  41. data/lib/mini_profiler/storage/abstract_store.rb +52 -1
  42. data/lib/mini_profiler/storage/file_store.rb +7 -3
  43. data/lib/mini_profiler/storage/memcache_store.rb +13 -7
  44. data/lib/mini_profiler/storage/memory_store.rb +100 -7
  45. data/lib/mini_profiler/storage/redis_store.rb +226 -3
  46. data/lib/mini_profiler/storage.rb +7 -0
  47. data/lib/mini_profiler/timer_struct/base.rb +2 -0
  48. data/lib/mini_profiler/timer_struct/custom.rb +1 -0
  49. data/lib/mini_profiler/timer_struct/page.rb +60 -4
  50. data/lib/mini_profiler/timer_struct/request.rb +53 -11
  51. data/lib/mini_profiler/timer_struct/sql.rb +6 -2
  52. data/lib/mini_profiler/timer_struct.rb +8 -0
  53. data/lib/mini_profiler/version.rb +2 -1
  54. data/lib/{mini_profiler/profiler.rb → mini_profiler.rb} +400 -83
  55. data/lib/mini_profiler_rails/railtie.rb +89 -7
  56. data/lib/mini_profiler_rails/railtie_methods.rb +61 -0
  57. data/lib/patches/db/activerecord.rb +1 -12
  58. data/lib/patches/db/mongo.rb +1 -1
  59. data/lib/patches/db/moped.rb +1 -1
  60. data/lib/patches/db/mysql2/alias_method.rb +30 -0
  61. data/lib/patches/db/mysql2/prepend.rb +34 -0
  62. data/lib/patches/db/mysql2.rb +4 -27
  63. data/lib/patches/db/plucky.rb +4 -4
  64. data/lib/patches/db/riak.rb +1 -1
  65. data/lib/patches/net_patches.rb +21 -10
  66. data/lib/patches/sql_patches.rb +13 -5
  67. data/lib/prepend_mysql2_patch.rb +5 -0
  68. data/lib/prepend_net_http_patch.rb +5 -0
  69. data/lib/rack-mini-profiler.rb +1 -24
  70. data/rack-mini-profiler.gemspec +17 -8
  71. metadata +156 -32
  72. data/lib/html/jquery.1.7.1.js +0 -4
  73. data/lib/html/jquery.tmpl.js +0 -486
  74. data/lib/html/list.css +0 -9
  75. data/lib/html/list.js +0 -38
  76. 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,48 @@
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-family: Helvetica, Arial, sans-serif;
73
+ font-size: 14px; }
74
+ .mp-snapshots .ta-left,
75
+ .profiler-result .ta-left,
76
+ .profiler-queries .ta-left {
77
+ text-align: left; }
78
+ .mp-snapshots .ta-right,
79
+ .profiler-result .ta-right,
80
+ .profiler-queries .ta-right {
81
+ text-align: right; }
26
82
 
27
83
  .profiler-result {
28
84
  font-family: Helvetica, Arial, sans-serif; }
29
85
  .profiler-result .profiler-toggle-duration-with-children {
30
86
  float: right; }
87
+ .profiler-result .profiler-snapshots-page-link {
88
+ float: left; }
31
89
  .profiler-result table.profiler-client-timings {
32
90
  margin-top: 10px; }
33
91
  .profiler-result .profiler-label {
@@ -38,9 +96,13 @@
38
96
  color: #767676; }
39
97
  .profiler-result .profiler-trivial {
40
98
  display: none; }
41
- .profiler-result .profiler-trivial td, .profiler-result .profiler-trivial td * {
99
+ .profiler-result .profiler-trivial td,
100
+ .profiler-result .profiler-trivial td * {
42
101
  color: #767676 !important; }
43
- .profiler-result pre, .profiler-result code, .profiler-result .profiler-number, .profiler-result .profiler-unit {
102
+ .profiler-result pre,
103
+ .profiler-result code,
104
+ .profiler-result .profiler-number,
105
+ .profiler-result .profiler-unit {
44
106
  font-family: Consolas, monospace, serif; }
45
107
  .profiler-result .profiler-number {
46
108
  color: #111; }
@@ -54,7 +116,8 @@
54
116
  background-color: #fff;
55
117
  color: #767676;
56
118
  text-align: right; }
57
- .profiler-result .profiler-timings th, .profiler-result .profiler-timings td {
119
+ .profiler-result .profiler-timings th,
120
+ .profiler-result .profiler-timings td {
58
121
  white-space: nowrap; }
59
122
  .profiler-result .profiler-timings .profiler-duration-with-children {
60
123
  display: none; }
@@ -63,8 +126,9 @@
63
126
  text-align: right; }
64
127
  .profiler-result .profiler-timings .profiler-indent {
65
128
  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; }
129
+ .profiler-result .profiler-timings .profiler-queries-show .profiler-number,
130
+ .profiler-result .profiler-timings .profiler-queries-show .profiler-unit {
131
+ color: #0077cc; }
68
132
  .profiler-result .profiler-timings .profiler-queries-duration {
69
133
  padding-left: 6px; }
70
134
  .profiler-result .profiler-timings .profiler-percent-in-sql {
@@ -89,13 +153,15 @@
89
153
  .profiler-result .profiler-queries tbody tr {
90
154
  border-bottom: 1px solid #f1f1f1; }
91
155
  .profiler-result .profiler-queries tr {
92
- background-color: #FFF; }
156
+ background-color: #fff; }
157
+ .profiler-result .profiler-queries tr.higlight-animate {
158
+ animation: highlight-in 3s; }
93
159
  .profiler-result .profiler-queries tr.slow {
94
- background-color: #FEE; }
160
+ background-color: #fee; }
95
161
  .profiler-result .profiler-queries tr.very-slow {
96
- background-color: #FDD; }
162
+ background-color: #fdd; }
97
163
  .profiler-result .profiler-queries tr.very-very-slow {
98
- background-color: #FCC; }
164
+ background-color: #fcc; }
99
165
  .profiler-result .profiler-queries pre {
100
166
  font-family: Consolas, monospace, serif;
101
167
  white-space: pre-wrap; }
@@ -110,12 +176,14 @@
110
176
  text-align: left; }
111
177
  .profiler-result .profiler-queries td:last-child {
112
178
  padding-right: 25px; }
113
- .profiler-result .profiler-queries .profiler-since-start, .profiler-result .profiler-queries .profiler-duration {
179
+ .profiler-result .profiler-queries .profiler-since-start,
180
+ .profiler-result .profiler-queries .profiler-duration {
114
181
  text-align: right; }
115
182
  .profiler-result .profiler-queries .profiler-info div {
116
183
  text-align: right;
117
184
  margin-bottom: 5px; }
118
- .profiler-result .profiler-queries .profiler-gap-info, .profiler-result .profiler-queries .profiler-gap-info td {
185
+ .profiler-result .profiler-queries .profiler-gap-info,
186
+ .profiler-result .profiler-queries .profiler-gap-info td {
119
187
  background-color: #ccc; }
120
188
  .profiler-result .profiler-queries .profiler-gap-info .profiler-unit {
121
189
  color: #777; }
@@ -147,9 +215,15 @@
147
215
  color: blue; }
148
216
  .profiler-result .profiler-queries .dec {
149
217
  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 {
218
+ .profiler-result .profiler-warning,
219
+ .profiler-result .profiler-warning *,
220
+ .profiler-result .profiler-warning .profiler-queries-show,
221
+ .profiler-result .profiler-warning .profiler-queries-show .profiler-unit {
151
222
  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 {
223
+ .profiler-result .profiler-warning:hover,
224
+ .profiler-result .profiler-warning *:hover,
225
+ .profiler-result .profiler-warning .profiler-queries-show:hover,
226
+ .profiler-result .profiler-warning .profiler-queries-show .profiler-unit:hover {
153
227
  color: #f00; }
154
228
  .profiler-result .profiler-nuclear {
155
229
  color: #f00;
@@ -165,39 +239,40 @@
165
239
  top: 0px; }
166
240
  .profiler-results.profiler-top.profiler-left {
167
241
  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 {
169
- -webkit-border-bottom-right-radius: 10px;
170
- -moz-border-radius-bottomright: 10px;
242
+ .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,
243
+ .profiler-results.profiler-top.profiler-left .profiler-controls {
171
244
  border-bottom-right-radius: 10px; }
172
- .profiler-results.profiler-top.profiler-left .profiler-button, .profiler-results.profiler-top.profiler-left .profiler-controls {
245
+ .profiler-results.profiler-top.profiler-left .profiler-button,
246
+ .profiler-results.profiler-top.profiler-left .profiler-controls {
173
247
  border-right: 1px solid #888; }
174
248
  .profiler-results.profiler-top.profiler-right {
175
249
  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 {
177
- -webkit-border-bottom-left-radius: 10px;
178
- -moz-border-radius-bottomleft: 10px;
250
+ .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,
251
+ .profiler-results.profiler-top.profiler-right .profiler-controls {
179
252
  border-bottom-left-radius: 10px; }
180
- .profiler-results.profiler-top.profiler-right .profiler-button, .profiler-results.profiler-top.profiler-right .profiler-controls {
253
+ .profiler-results.profiler-top.profiler-right .profiler-button,
254
+ .profiler-results.profiler-top.profiler-right .profiler-controls {
181
255
  border-left: 1px solid #888; }
182
256
  .profiler-results.profiler-bottom {
183
257
  bottom: 0px; }
184
258
  .profiler-results.profiler-bottom.profiler-left {
185
259
  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 {
187
- -webkit-border-top-right-radius: 10px;
188
- -moz-border-radius-topright: 10px;
260
+ .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,
261
+ .profiler-results.profiler-bottom.profiler-left .profiler-controls {
189
262
  border-top-right-radius: 10px; }
190
- .profiler-results.profiler-bottom.profiler-left .profiler-button, .profiler-results.profiler-bottom.profiler-left .profiler-controls {
263
+ .profiler-results.profiler-bottom.profiler-left .profiler-button,
264
+ .profiler-results.profiler-bottom.profiler-left .profiler-controls {
191
265
  border-right: 1px solid #888; }
192
266
  .profiler-results.profiler-bottom.profiler-right {
193
267
  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 {
195
- -webkit-border-bottom-top-radius: 10px;
196
- -moz-border-radius-topleft: 10px;
268
+ .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,
269
+ .profiler-results.profiler-bottom.profiler-right .profiler-controls {
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 {
@@ -244,8 +324,6 @@
244
324
  text-align: left;
245
325
  line-height: 18px;
246
326
  overflow: auto;
247
- -moz-box-shadow: 0px 1px 15px #555;
248
- -webkit-box-shadow: 0px 1px 15px #555;
249
327
  box-shadow: 0px 1px 15px #555; }
250
328
  .profiler-results .profiler-popup .profiler-info {
251
329
  margin-bottom: 3px;
@@ -258,7 +336,8 @@
258
336
  display: none; }
259
337
  .profiler-results .profiler-popup .profiler-info .profiler-server-time {
260
338
  font-size: 95%; }
261
- .profiler-results .profiler-popup .profiler-timings th, .profiler-results .profiler-popup .profiler-timings td {
339
+ .profiler-results .profiler-popup .profiler-timings th,
340
+ .profiler-results .profiler-popup .profiler-timings td {
262
341
  padding-left: 6px;
263
342
  padding-right: 6px; }
264
343
  .profiler-results .profiler-popup .profiler-timings th {
@@ -288,7 +367,6 @@
288
367
  @media print {
289
368
  .profiler-results {
290
369
  display: none; } }
291
-
292
370
  .profiler-queries-bg {
293
371
  z-index: 2147483642;
294
372
  display: none;
@@ -313,7 +391,8 @@
313
391
  padding-right: 20px;
314
392
  font-size: 80%;
315
393
  color: #888; }
316
- .profiler-result-full .profiler-result .profiler-popup .profiler-timings td, .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
394
+ .profiler-result-full .profiler-result .profiler-popup .profiler-timings td,
395
+ .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
317
396
  padding-left: 8px;
318
397
  padding-right: 8px; }
319
398
  .profiler-result-full .profiler-result .profiler-popup .profiler-timings th {
@@ -339,3 +418,23 @@
339
418
  .profiler-result-full .profiler-result .profiler-queries .profiler-info div {
340
419
  text-align: right;
341
420
  margin-bottom: 5px; }
421
+
422
+ @keyframes highlight-in {
423
+ 0% {
424
+ background: #ffffbb; }
425
+ 100% {
426
+ background: #fff; } }
427
+
428
+ .mp-snapshots {
429
+ font-family: Helvetica, Arial, sans-serif;
430
+ font-size: 16px; }
431
+ .mp-snapshots .snapshots-table thead {
432
+ background: #6a737c;
433
+ color: #ffffff; }
434
+ .mp-snapshots .snapshots-table th, .mp-snapshots .snapshots-table td {
435
+ padding: 5px 10px;
436
+ box-sizing: border-box; }
437
+ .mp-snapshots .snapshots-table th:not(.request-group), .mp-snapshots .snapshots-table td:not(.request-group) {
438
+ text-align: center; }
439
+ .mp-snapshots .snapshots-table th {
440
+ border-right: 1px solid #ffffff; }