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.
@@ -1,11 +1,14 @@
1
- - events.each do |event|
2
- .event(id="event-#{event.id}")
3
- .event-info
4
- h3.event-name
5
- a(href="#event-#{event.id}")
6
- = event.name
7
- span.duration-ms= "%06.1fms" % (event.duration * 1000.0)
8
- .event-payload
9
- == partial('payload', locals: { name: event.name, payload: event.payload })
10
- .event-children
11
- == partial('events', locals: { events: event.children })
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-#{line_id(bt[0], bt[1])}")= bt.join(':')
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
- .shortpath {
15
- display: block;
16
- font-weight: bold;
17
- }
26
+ // Classes
18
27
 
19
- .fullpath {
20
- display: block;
21
- font-size: 20%;
22
- font-weight: normal;
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: 10px;
30
- margin-top: -0.9em;
31
- padding: 0 0.5em;
32
- background-color: #ECEEF1;
33
- color: #363947;
34
- border-radius: 4px;
35
- font-size: 80%;
36
- line-height: 1.8;
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
- #container {
40
- position: relative;
41
- margin: 0 auto;
42
- width: 100%;
43
- height: 100%;
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
- &.tab-sources {
82
- background-color: #0E7AC4;
83
- }
84
- &.tab-events {
85
- background-color: #FBA848;
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
- #details {
68
+ .tabs {
92
69
  position: absolute;
93
- top: 80px;
94
- left: 0;
70
+ top: 0;
95
71
  right: 0;
96
- bottom: 0;
97
- overflow: hidden;
98
- }
99
- }
72
+ line-height: 28px;
100
73
 
101
- #sources, #events {
102
- display: none;
103
- &.active {
104
- z-index: 1;
105
- display: block;
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: 0;
93
+ top: 36px;
113
94
  left: 0;
114
95
  right: 0;
115
96
  bottom: 0;
116
97
 
117
- #source-list,
118
- #source-code {
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
- .clearfix:after {
151
- content:"";
152
- display:block;
153
- clear:both;
103
+ #events {
104
+ overflow-y: auto;
105
+ background-color: #fff;
154
106
  }
155
107
 
156
- .source {
157
- display: none;
158
-
159
- &.active {
160
- display: block;
161
- }
162
-
163
- .filename {
164
- font-size: 100%;
165
- background-color: #0E7AC4;
166
- margin: 0;
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
- .source-code {
177
- background-color: #202223;
178
- color: #fff;
179
- line-height: 1.5;
180
- }
121
+ .icon-square-minus {
122
+ display: none;
123
+ }
181
124
 
182
- .header {
183
- margin-bottom: 5px;
184
- padding-bottom: 10px;
185
- border-bottom: 1px solid #fff;
186
- }
125
+ .event-payload {
126
+ display: none;
127
+ }
128
+ }
187
129
 
188
- .line-infos {
189
- float: left;
190
- padding: 10px 0;
191
- }
130
+ .icon-square-plus {
131
+ display: none;
132
+ }
192
133
 
193
- .line-info {
194
- @extend .clearfix;
134
+ .icon-square-minus {
135
+ display: inline-block;
136
+ }
195
137
 
196
- & > * {
197
- padding: 0 .5em;
198
- float: left;
199
- }
138
+ .event-name {
139
+ position: relative;
140
+ margin: 0;
141
+ padding: 10px 10px;
142
+ background-color: $darkYellow;
200
143
 
201
- .line-cpu, .line-wall {
202
- width: 6em;
203
- text-align: right;
204
- }
144
+ a {
145
+ display: block;
146
+ color: #fff;
147
+ text-decoration: none;
148
+ }
149
+ }
205
150
 
206
- .line-allocs {
207
- width: 6em;
208
- text-align: right;
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
- .line-calls {
212
- width: 5em;
213
- }
187
+ .event-children {
188
+ padding-left: 20px;
189
+ }
214
190
 
215
- .line-no {
216
- width: 3em;
217
- padding: 0;
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
- .line-info,
229
- .line-code {
230
- &.focus {
231
- font-weight: bold;
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
- #events {
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
- .event {
261
- .event-name {
262
- position: relative;
263
- margin: 0;
264
- padding: 0;
265
- font-size: 120%;
266
- background-color: #FBA848;
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: #fff;
236
+ color: $darkBlue;
272
237
  text-decoration: none;
273
238
  }
274
- }
275
239
 
276
- .event-payload {
277
- display: none;
278
- }
279
-
280
- &.expand {
281
- .event-payload {
240
+ .shortpath, .fullpath {
282
241
  display: block;
283
242
  }
284
- }
285
243
 
286
- .payload {
287
- font-family: monospace;
288
- border-collapse: collapse;
289
- border: 0;
244
+ .shortpath {
245
+ margin-bottom: 5px;
246
+ }
290
247
 
291
- td {
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
- td.table {
297
- padding: 0;
298
- }
257
+ #source-code {
258
+ left: 300px;
259
+ right: 0;
260
+ overflow-x: hidden;
299
261
 
300
- td.payload-key {
301
- vertical-align: top;
302
- min-width: 12em;
303
- background-color: #ECEEF1;
304
- }
262
+ .source {
263
+ display: none;
305
264
 
306
- .backtraces {
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
- .event-children {
320
- padding-left: 30px;
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
  }