speed_gun 2.0.0.pre.alpha.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/rails/app/controllers/posts_controller.rb +2 -0
- data/lib/rack/speed_gun.rb +4 -4
- data/lib/speed_gun.rb +17 -0
- data/lib/speed_gun/app.rb +6 -3
- data/lib/speed_gun/app/public/feather.css +572 -0
- data/lib/speed_gun/app/public/fonts/feather-webfont.eot +0 -0
- data/lib/speed_gun/app/public/fonts/feather-webfont.svg +158 -0
- data/lib/speed_gun/app/public/fonts/feather-webfont.ttf +0 -0
- data/lib/speed_gun/app/public/fonts/feather-webfont.woff +0 -0
- data/lib/speed_gun/app/public/report.js +21 -12
- data/lib/speed_gun/app/views/_hint.scss +648 -0
- data/lib/speed_gun/app/views/events.slim +14 -11
- data/lib/speed_gun/app/views/payload.slim +7 -1
- data/lib/speed_gun/app/views/report.scss +246 -228
- data/lib/speed_gun/app/views/report.slim +11 -39
- data/lib/speed_gun/app/views/sources.slim +35 -0
- data/lib/speed_gun/event.rb +1 -1
- data/lib/speed_gun/hook.rb +52 -0
- data/lib/speed_gun/hook/net/http.rb +32 -0
- data/lib/speed_gun/profiler.rb +2 -0
- data/lib/speed_gun/profiler/active_support_notifications_profiler.rb +3 -6
- data/lib/speed_gun/profiler/http_profiler.rb +4 -0
- data/lib/speed_gun/railtie.rb +4 -0
- data/lib/speed_gun/report.rb +4 -0
- data/lib/speed_gun/version.rb +1 -7
- metadata +14 -4
@@ -1,11 +1,14 @@
|
|
1
|
-
-
|
2
|
-
.event
|
3
|
-
.event
|
4
|
-
|
5
|
-
|
6
|
-
=
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
#event-details
|
2
|
+
- events.each do |event|
|
3
|
+
.event(id="event-#{event.id}")
|
4
|
+
.event-info.closed
|
5
|
+
h3.event-name
|
6
|
+
a(href="#event-#{event.id}")
|
7
|
+
span.icon-square-plus
|
8
|
+
span.icon-square-minus
|
9
|
+
= event.name
|
10
|
+
span.duration-ms= "%06.1fms" % (event.duration * 1000.0)
|
11
|
+
.event-payload
|
12
|
+
== partial('payload', locals: { name: event.name, payload: event.payload })
|
13
|
+
.event-children
|
14
|
+
== partial('events', locals: { events: event.children })
|
@@ -11,7 +11,13 @@ table.payload
|
|
11
11
|
ul.backtraces
|
12
12
|
- val.each do |bt|
|
13
13
|
li.backtrace
|
14
|
-
a(href="#line-#{
|
14
|
+
a(href="#line-#{source_line_id(bt[0], bt[1])}")
|
15
|
+
.backtrace-file
|
16
|
+
= bt.first
|
17
|
+
span.icon-fast-forward
|
18
|
+
.backtrace-line
|
19
|
+
= "at #{bt[1]}"
|
20
|
+
= " in #{bt[2]}"
|
15
21
|
- else
|
16
22
|
td= val.join(', ')
|
17
23
|
- when String, Integer
|
@@ -1,322 +1,340 @@
|
|
1
|
+
@import 'hint';
|
2
|
+
|
3
|
+
$darkBlue: #252839;
|
4
|
+
$darkGray: #677077;
|
5
|
+
$lightGray: #b5b5b7;
|
6
|
+
$darkYellow: #f2b632;
|
7
|
+
$monospace: Ricty, Consolas, 'Courier New', Courier, Monaco, monospace;
|
8
|
+
|
1
9
|
* {
|
2
10
|
box-sizing: border-box;
|
11
|
+
font-size: 100%;
|
3
12
|
}
|
4
13
|
|
5
14
|
html, body {
|
15
|
+
font-size: 12px;
|
6
16
|
position: relative;
|
7
17
|
margin: 0;
|
8
18
|
padding: 0;
|
9
19
|
width: 100%;
|
10
20
|
height: 100%;
|
11
21
|
overflow: hidden;
|
22
|
+
background-color: $darkBlue;
|
23
|
+
font-family: $monospace;
|
12
24
|
}
|
13
25
|
|
14
|
-
|
15
|
-
display: block;
|
16
|
-
font-weight: bold;
|
17
|
-
}
|
26
|
+
// Classes
|
18
27
|
|
19
|
-
.
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
.clearfix:after {
|
29
|
+
content: "";
|
30
|
+
display: block;
|
31
|
+
clear: both;
|
23
32
|
}
|
24
33
|
|
25
34
|
.duration-ms {
|
26
|
-
display: block;
|
27
35
|
position: absolute;
|
28
36
|
top: 50%;
|
29
|
-
right:
|
30
|
-
margin-top:
|
31
|
-
|
32
|
-
background-color:
|
33
|
-
color: #
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
right: 20px;
|
38
|
+
margin-top: -.6em;
|
39
|
+
font-weight: normal;
|
40
|
+
background-color: rgba(0, 0, 0, .3);
|
41
|
+
color: #fff;
|
42
|
+
line-height: 1;
|
43
|
+
padding: 0.2em 10px;
|
44
|
+
border-radius: 2px;
|
37
45
|
}
|
38
46
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
overflow: hidden;
|
45
|
-
|
46
|
-
#report {
|
47
|
-
background-color: #58BE89;
|
48
|
-
color: #fff;
|
49
|
-
|
50
|
-
.report-id {
|
51
|
-
position: relative;
|
52
|
-
font-size: 100%;
|
53
|
-
height: 50px;
|
54
|
-
line-height: 50px;
|
55
|
-
margin: 0;
|
56
|
-
padding: 0 20px;
|
57
|
-
}
|
58
|
-
|
59
|
-
.tabs {
|
60
|
-
display: -webkit-flex;
|
61
|
-
display: flex;
|
62
|
-
-webkit-flex-direction: row;
|
63
|
-
flex-direction: row;
|
64
|
-
-webkit-flex-wrap: nowrap;
|
65
|
-
flex-wrap: nowrap;
|
66
|
-
-webkit-justify-content: space-around;
|
67
|
-
justify-content: space-around;
|
68
|
-
|
69
|
-
a {
|
70
|
-
display: block;
|
71
|
-
-webkit-flex-grow: 1; /* Safari */
|
72
|
-
flex-grow: 1;
|
73
|
-
height: 30px;
|
74
|
-
margin: 0 20px;
|
75
|
-
line-height: 30px;
|
76
|
-
font-size: 14px;
|
77
|
-
text-align: center;
|
78
|
-
color: #fff;
|
79
|
-
text-decoration: none;
|
47
|
+
[class^="icon-"] {
|
48
|
+
margin-right: 5px;
|
49
|
+
vertical-align: baseline;
|
50
|
+
font-size: 120%;
|
51
|
+
}
|
80
52
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
53
|
+
#report {
|
54
|
+
position: relative;
|
55
|
+
background-color: #efefef;
|
56
|
+
color: $darkBlue;
|
57
|
+
line-height: 36px;
|
58
|
+
height: 36px;
|
59
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
|
60
|
+
z-index: 10;
|
61
|
+
|
62
|
+
h1 {
|
63
|
+
position: relative;
|
64
|
+
margin: 0 300px 0 0;
|
65
|
+
padding: 0 20px;
|
89
66
|
}
|
90
67
|
|
91
|
-
|
68
|
+
.tabs {
|
92
69
|
position: absolute;
|
93
|
-
top:
|
94
|
-
left: 0;
|
70
|
+
top: 0;
|
95
71
|
right: 0;
|
96
|
-
|
97
|
-
overflow: hidden;
|
98
|
-
}
|
99
|
-
}
|
72
|
+
line-height: 28px;
|
100
73
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
74
|
+
& > a {
|
75
|
+
display: inline-block;
|
76
|
+
padding: 4px 20px 0 20px;
|
77
|
+
text-decoration: none;
|
78
|
+
color: $darkBlue;
|
79
|
+
width: 150px;
|
80
|
+
text-align: center;
|
81
|
+
border-bottom: 4px solid transparent;
|
82
|
+
transition: border-bottom-color .2s ease-in-out;
|
83
|
+
|
84
|
+
&.active {
|
85
|
+
border-bottom-color: lighten($darkBlue, 20%);
|
86
|
+
}
|
87
|
+
}
|
106
88
|
}
|
107
89
|
}
|
108
90
|
|
109
|
-
#sources {
|
110
|
-
font-family: monospace;
|
91
|
+
#events, #sources {
|
111
92
|
position: absolute;
|
112
|
-
top:
|
93
|
+
top: 36px;
|
113
94
|
left: 0;
|
114
95
|
right: 0;
|
115
96
|
bottom: 0;
|
116
97
|
|
117
|
-
|
118
|
-
|
119
|
-
position: absolute;
|
120
|
-
top: 0;
|
121
|
-
bottom: 0;
|
122
|
-
overflow-y: auto;
|
123
|
-
}
|
124
|
-
|
125
|
-
#source-list {
|
126
|
-
left: 0;
|
127
|
-
width: 30%;
|
128
|
-
word-break: break-all;
|
129
|
-
|
130
|
-
a {
|
131
|
-
display: block;
|
132
|
-
background-color: #0E7AC4;
|
133
|
-
color: #fff;
|
134
|
-
text-decoration: none;
|
135
|
-
padding: 10px 20px;
|
136
|
-
|
137
|
-
&.active, &:hover, &:active, &:target {
|
138
|
-
background-color: darken(#0E7AC4, 30%);
|
139
|
-
}
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
#source-code {
|
144
|
-
left: 30%;
|
145
|
-
right: 0;
|
146
|
-
background-color: #202223;
|
98
|
+
&.active {
|
99
|
+
z-index: 1;
|
147
100
|
}
|
148
101
|
}
|
149
102
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
clear:both;
|
103
|
+
#events {
|
104
|
+
overflow-y: auto;
|
105
|
+
background-color: #fff;
|
154
106
|
}
|
155
107
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
a {
|
169
|
-
display: block;
|
170
|
-
padding: 1em 2em;
|
171
|
-
color: #fff;
|
172
|
-
text-decoration: none;
|
173
|
-
}
|
174
|
-
}
|
108
|
+
#event-details {
|
109
|
+
.event {
|
110
|
+
.event-info {
|
111
|
+
margin: 20px;
|
112
|
+
border: 1px solid $darkYellow;
|
113
|
+
border-radius: 4px;
|
114
|
+
overflow: hidden;
|
115
|
+
|
116
|
+
&.closed {
|
117
|
+
.icon-square-plus {
|
118
|
+
display: inline-block;
|
119
|
+
}
|
175
120
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
line-height: 1.5;
|
180
|
-
}
|
121
|
+
.icon-square-minus {
|
122
|
+
display: none;
|
123
|
+
}
|
181
124
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
}
|
125
|
+
.event-payload {
|
126
|
+
display: none;
|
127
|
+
}
|
128
|
+
}
|
187
129
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
}
|
130
|
+
.icon-square-plus {
|
131
|
+
display: none;
|
132
|
+
}
|
192
133
|
|
193
|
-
|
194
|
-
|
134
|
+
.icon-square-minus {
|
135
|
+
display: inline-block;
|
136
|
+
}
|
195
137
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
138
|
+
.event-name {
|
139
|
+
position: relative;
|
140
|
+
margin: 0;
|
141
|
+
padding: 10px 10px;
|
142
|
+
background-color: $darkYellow;
|
200
143
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
144
|
+
a {
|
145
|
+
display: block;
|
146
|
+
color: #fff;
|
147
|
+
text-decoration: none;
|
148
|
+
}
|
149
|
+
}
|
205
150
|
|
206
|
-
|
207
|
-
|
208
|
-
|
151
|
+
.event-payload {
|
152
|
+
table {
|
153
|
+
margin: 0;
|
154
|
+
width: 100%;
|
155
|
+
border-collapse: collapse;
|
156
|
+
|
157
|
+
td {
|
158
|
+
padding: 10px 20px;
|
159
|
+
border: 1px solid #ccc;
|
160
|
+
border-width: 0 1px 1px 0;
|
161
|
+
vertical-align: top;
|
162
|
+
word-wrap: break-word;
|
163
|
+
word-break: break-all;
|
164
|
+
|
165
|
+
&:first-child {
|
166
|
+
width: 150px;
|
167
|
+
background-color: #efefef;
|
168
|
+
}
|
169
|
+
|
170
|
+
&:last-child {
|
171
|
+
border-right-width: 0;
|
172
|
+
}
|
173
|
+
|
174
|
+
&.table {
|
175
|
+
padding: 0;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
& tr:last-child > td {
|
180
|
+
border-bottom-width: 0;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
209
184
|
}
|
185
|
+
}
|
210
186
|
|
211
|
-
|
212
|
-
|
213
|
-
|
187
|
+
.event-children {
|
188
|
+
padding-left: 20px;
|
189
|
+
}
|
214
190
|
|
215
|
-
|
216
|
-
|
217
|
-
|
191
|
+
.backtraces {
|
192
|
+
margin: 0;
|
193
|
+
padding: 0;
|
194
|
+
list-style: none outside;
|
218
195
|
|
196
|
+
.backtrace {
|
219
197
|
a {
|
220
198
|
display: block;
|
221
199
|
color: inherit;
|
222
200
|
text-decoration: none;
|
223
|
-
text-align: right;
|
224
|
-
}
|
225
|
-
}
|
226
|
-
}
|
227
201
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
color: #F27398;
|
233
|
-
}
|
234
|
-
}
|
235
|
-
|
236
|
-
pre.line-codes {
|
237
|
-
overflow-x: auto;
|
238
|
-
margin: 0;
|
239
|
-
padding: 10px 0;
|
240
|
-
|
241
|
-
.line-code {
|
242
|
-
padding-left: 2em;
|
243
|
-
padding-right: 2em;
|
202
|
+
.icon-fast-forward {
|
203
|
+
margin-left: 10px;
|
204
|
+
}
|
205
|
+
}
|
244
206
|
}
|
245
207
|
}
|
208
|
+
}
|
246
209
|
|
210
|
+
#sources {
|
211
|
+
background-color: $darkBlue;
|
247
212
|
}
|
248
213
|
|
249
|
-
#
|
214
|
+
#source-list, #source-code {
|
250
215
|
position: absolute;
|
251
216
|
top: 0;
|
252
|
-
left: 0;
|
253
|
-
right: 0;
|
254
217
|
bottom: 0;
|
255
218
|
overflow-y: auto;
|
256
|
-
background-color: #fff;
|
257
|
-
padding-bottom: 30px;
|
258
219
|
}
|
259
220
|
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
221
|
+
#source-list {
|
222
|
+
left: 0;
|
223
|
+
width: 300px;
|
224
|
+
background-color: #fff;
|
225
|
+
|
226
|
+
.source-link {
|
227
|
+
border-bottom: 1px solid #ccc;
|
228
|
+
|
229
|
+
&.focus {
|
230
|
+
background-color: #eee;
|
231
|
+
}
|
267
232
|
|
268
233
|
a {
|
269
234
|
display: block;
|
270
235
|
padding: 10px 20px;
|
271
|
-
color:
|
236
|
+
color: $darkBlue;
|
272
237
|
text-decoration: none;
|
273
238
|
}
|
274
|
-
}
|
275
239
|
|
276
|
-
|
277
|
-
display: none;
|
278
|
-
}
|
279
|
-
|
280
|
-
&.expand {
|
281
|
-
.event-payload {
|
240
|
+
.shortpath, .fullpath {
|
282
241
|
display: block;
|
283
242
|
}
|
284
|
-
}
|
285
243
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
border: 0;
|
244
|
+
.shortpath {
|
245
|
+
margin-bottom: 5px;
|
246
|
+
}
|
290
247
|
|
291
|
-
|
248
|
+
.fullpath {
|
249
|
+
font-size: 9px;
|
250
|
+
word-wrap: break-word;
|
251
|
+
overflow-wrap: break-word;
|
292
252
|
word-break: break-all;
|
293
|
-
padding: 5px 10px;
|
294
253
|
}
|
254
|
+
}
|
255
|
+
}
|
295
256
|
|
296
|
-
|
297
|
-
|
298
|
-
|
257
|
+
#source-code {
|
258
|
+
left: 300px;
|
259
|
+
right: 0;
|
260
|
+
overflow-x: hidden;
|
299
261
|
|
300
|
-
|
301
|
-
|
302
|
-
min-width: 12em;
|
303
|
-
background-color: #ECEEF1;
|
304
|
-
}
|
262
|
+
.source {
|
263
|
+
display: none;
|
305
264
|
|
306
|
-
.
|
265
|
+
.filename {
|
307
266
|
margin: 0;
|
308
|
-
padding: 0;
|
309
|
-
list-style: none outside;
|
310
267
|
|
311
268
|
a {
|
269
|
+
background-color: lighten($darkBlue, 20%);
|
312
270
|
display: block;
|
271
|
+
padding: 10px 20px;
|
272
|
+
color: #fff;
|
313
273
|
text-decoration: none;
|
314
|
-
color: #0E7AC4;
|
315
274
|
}
|
316
275
|
}
|
317
276
|
}
|
318
277
|
|
319
|
-
.
|
320
|
-
|
278
|
+
.source-line {
|
279
|
+
position: relative;
|
280
|
+
margin: 0;
|
281
|
+
padding: 0 0 0 400px;
|
282
|
+
color: #fff;
|
283
|
+
font-size: 14px;
|
284
|
+
transition: all .2s ease-in-out;
|
285
|
+
|
286
|
+
&.focus {
|
287
|
+
color: $darkYellow;
|
288
|
+
background-color: lighten($darkBlue, 20%);
|
289
|
+
}
|
290
|
+
|
291
|
+
.line-info {
|
292
|
+
@extend .clearfix;
|
293
|
+
position: absolute;
|
294
|
+
width: 400px;
|
295
|
+
top: 0;
|
296
|
+
left: 0;
|
297
|
+
}
|
298
|
+
|
299
|
+
.line-info div {
|
300
|
+
float: left;
|
301
|
+
text-align: right;
|
302
|
+
}
|
303
|
+
|
304
|
+
.line-info a {
|
305
|
+
display: block;
|
306
|
+
color: inherit;
|
307
|
+
text-decoration: none;
|
308
|
+
}
|
309
|
+
|
310
|
+
.line-cpu,
|
311
|
+
.line-wall,
|
312
|
+
.line-allocs {
|
313
|
+
width: 90px;
|
314
|
+
}
|
315
|
+
|
316
|
+
.line-calls {
|
317
|
+
width: 60px;
|
318
|
+
}
|
319
|
+
|
320
|
+
.line-no {
|
321
|
+
width: 70px;
|
322
|
+
padding-right: 20px;
|
323
|
+
}
|
324
|
+
|
325
|
+
.line-code {
|
326
|
+
margin: 0;
|
327
|
+
padding: 0;
|
328
|
+
width: 100%;
|
329
|
+
font-family: $monospace;
|
330
|
+
word-wrap: break-word;
|
331
|
+
overflow-wrap: break-word;
|
332
|
+
word-break: break-all;
|
333
|
+
white-space: pre-wrap;
|
334
|
+
}
|
335
|
+
|
336
|
+
.line-info, .line-code {
|
337
|
+
line-height: 2;
|
338
|
+
}
|
321
339
|
}
|
322
340
|
}
|