rorvswild 1.7.1 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,18 +100,51 @@
100
100
  }
101
101
 
102
102
  .rorvswild-local-panel__header .rorvswild-local-panel__width-limiter {
103
- display: flex;
104
- padding: 12px !important;
103
+ display: flex !important;
104
+ align-items: center !important;
105
+ gap: 24px !important;
106
+ padding: 0 12px !important;
105
107
  }
106
108
 
107
-
108
- .rorvswild-local-panel__header__title {
109
- color: rgb(199 203 214) !important;
109
+ .rorvswild-local-panel__header nav {
110
110
  text-transform: uppercase !important;
111
111
  font-size: 12px !important;
112
- letter-spacing: 2px !important;
113
- text-align: center !important;
114
- flex: 1;
112
+ font-weight: 700 !important;
113
+ letter-spacing: 1px !important;
114
+ flex: 1 !important;
115
+ }
116
+
117
+ .rorvswild-local-panel__header nav ul {
118
+ padding: 0 !important;
119
+ margin: 0 !important;
120
+ list-style-type: none !important;
121
+ display: flex !important;
122
+ gap: 12px !important;
123
+ }
124
+
125
+ .rorvswild-local-panel__header nav li {
126
+ color: rgb(146 149 159) !important;
127
+ cursor: pointer !important;
128
+ line-height: 48px !important;
129
+ }
130
+
131
+ .rorvswild-local-panel__header nav li:hover {
132
+ color: rgb(199 203 214) !important;
133
+ }
134
+
135
+ [data-tab="requests"] .tab--requests {
136
+ color: rgb(199 203 214) !important;
137
+ box-shadow: 0 -3px 0 0 rgb(199 203 214) inset !important;
138
+ }
139
+
140
+ [data-tab="jobs"] .tab--jobs {
141
+ color: rgb(199 203 214) !important;
142
+ box-shadow: 0 -3px 0 0 rgb(199 203 214) inset !important;
143
+ }
144
+
145
+ [data-tab="errors"] .tab--errors {
146
+ color: rgb(199 203 214) !important;
147
+ box-shadow: 0 -3px 0 0 rgb(199 203 214) inset !important;
115
148
  }
116
149
 
117
150
  .rorvswild-local-panel svg {
@@ -127,8 +160,6 @@
127
160
 
128
161
  .rorvswild-local-panel svg:hover { stroke: rgb(199 203 214) !important; }
129
162
 
130
- .rorvswild-local-panel__logo { width: 60px !important; }
131
-
132
163
  .rorvswild-local-panel__header__icons {
133
164
  width: 60px !important;
134
165
  display: flex !important;
@@ -158,6 +189,14 @@
158
189
  overscroll-behavior: contain;
159
190
  }
160
191
 
192
+ .rorvswild-local-panel--blank {
193
+ text-align: center !important;
194
+ margin: 0 auto !important;
195
+ font-size: 31px !important;
196
+ line-height: calc(100dvh - 120px) !important;
197
+ color: rgb(26 29 36) !important;
198
+ }
199
+
161
200
  .rorvswild-local-panel__content::-webkit-scrollbar { width: 4px !important; }
162
201
 
163
202
  .rorvswild-local-panel__content::-webkit-scrollbar-corner { background: transparent !important; }
@@ -173,7 +212,7 @@
173
212
  }
174
213
 
175
214
  /* Panel request summary */
176
- .rorvswild-local-panel__request {
215
+ .rorvswild-local-panel__row {
177
216
  display: flex !important;
178
217
  padding: 12px 12px 11px !important;
179
218
  border-bottom: 1px solid rgb(26 29 36) !important;
@@ -181,24 +220,52 @@
181
220
  flex-wrap: wrap !important;
182
221
  }
183
222
 
184
- .rorvswild-local-panel__request:hover { background: rgb(26 29 36) !important; }
223
+ .rorvswild-local-panel__row:first-of-type {
224
+ margin-top: 12px !important;
225
+ }
226
+
227
+ .rorvswild-local-panel__row:hover { background: rgb(26 29 36) !important; }
185
228
 
186
- .rorvswild-local-panel__request__name {
229
+ .rorvswild-local-panel__name {
187
230
  word-break: break-all !important;
188
231
  overflow-wrap: break-word !important;
189
232
  width: 100% !important;
190
233
  color: rgb(199 203 214) !important;
191
- font-weight: 700;
234
+ font-weight: 700 !important;
192
235
  }
193
236
 
194
- .rorvswild-local-panel__request__name > span {
195
- text-decoration-color: rgb(146 149 159);
196
- text-decoration: underline;
197
- text-decoration-thickness: 1px;
198
- text-underline-offset: 1px;
237
+ .rorvswild-local-panel__row:hover .rorvswild-local-panel__name { color: rgb(223 228 242) !important; }
238
+
239
+ .rorvswild-local-panel__row .rorvswild-local-panel__name > span {
240
+ text-decoration-color: rgb(146 149 159) !important;
241
+ text-decoration: underline !important;
242
+ text-decoration-thickness: 1px !important;
243
+ text-underline-offset: 1px !important;
244
+ }
245
+
246
+ .rorvswild-local-panel__row.rorvswild-local-panel__error .rorvswild-local-panel__name {
247
+ color: rgb(146 149 159) !important;
248
+ font-weight: 400 !important;
249
+ word-break: keep-all;
250
+ text-overflow: ellipsis;
251
+ white-space: nowrap;
252
+ overflow: hidden;
253
+ }
254
+
255
+ .rorvswild-local-panel__row.rorvswild-local-panel__error .rorvswild-local-panel__name > span,
256
+ .rorvswild-local-panel__error .rorvswild-local-panel__title {
257
+ color: rgb(255 184 172) !important;
258
+ font-weight: 700 !important;
199
259
  }
200
260
 
201
- .rorvswild-local-panel__request__path {
261
+ .rorvswild-local-panel__row.rorvswild-local-panel__error:hover .rorvswild-local-panel__name > span { color: rgb(255 220 214) !important; }
262
+
263
+
264
+ .rorvswild-local-panel__error .rorvswild-local-panel__path {
265
+ color: rgb(199 203 214) !important;
266
+ }
267
+
268
+ .rorvswild-local-panel__path {
202
269
  color: rgb(146 149 159) !important;
203
270
  font-weight: 400;
204
271
  display: block !important;
@@ -207,12 +274,12 @@
207
274
  text-decoration-color: transparent !important;
208
275
  }
209
276
 
210
- .rorvswild-local-panel__request__started-at {
277
+ .rorvswild-local-panel__started-at {
211
278
  color: rgb(146 149 159) !important;
212
279
  margin-left: 12px !important;
213
280
  }
214
281
 
215
- .rorvswild-local-panel__request__runtime {
282
+ .rorvswild-local-panel__runtime {
216
283
  color: rgb(182 202 255) !important;
217
284
  font-weight: 700 !important;
218
285
  }
@@ -224,14 +291,14 @@
224
291
  display: block !important;
225
292
  }
226
293
 
227
- .rorvswild-local-panel__request-details__request {
294
+ .rorvswild-local-panel__details__header {
228
295
  display: flex !important;
229
- margin-bottom: 48px !important;
230
- padding: 12px 12px 0 !important;
296
+ margin-bottom: 36px !important;
297
+ padding: 48px 12px 0 !important;
231
298
  flex-wrap: wrap !important;
232
299
  }
233
300
 
234
- h2.rorvswild-local-panel__request__name__title {
301
+ h2.rorvswild-local-panel__title {
235
302
  margin:-18px 0 0 !important;
236
303
  padding:0 !important;
237
304
  font-size: 31px !important;
@@ -242,25 +309,60 @@ h2.rorvswild-local-panel__request__name__title {
242
309
  }
243
310
 
244
311
  /* details sections */
245
- .rorvswild-local-panel__request-details__section {
312
+ .rorvswild-local-panel__breakdown {
313
+ display: flex !important;
314
+ position: relative !important;
315
+ width: calc(100% - 24px) !important;
316
+ margin: 0 12px 12px !important;
317
+ padding: 0 !important;
318
+ text-align: center !important;
319
+ }
320
+
321
+ .rorvswild-local-panel__breakdown li {
322
+ display: inline-block !important;
323
+ margin: 0 !important;
324
+ padding: 0 8px !important;
325
+ white-space: nowrap !important;
326
+ overflow: hidden !important;
327
+ border: 1px solid rgb(26 29 36) !important;
328
+ font-size: 10px !important;
329
+ text-transform: uppercase !important;
330
+ letter-spacing: 1px !important;
331
+ }
332
+
333
+ .rorvswild-local-panel__breakdown li:first-of-type { background-color:rgba(199, 203, 214, .08) !important; }
334
+
335
+ .rorvswild-local-panel__breakdown li:nth-of-type(2) { background-color:rgba(199, 203, 214, .04) !important; }
336
+
337
+ .rorvswild-local-panel__breakdown li:nth-of-type(3) { background-color:rgba(199, 203, 214, .02) !important; }
338
+
339
+ .rorvswild-local-panel__breakdown__label {
340
+ display: inline-block;
341
+ font-weight: 400;
342
+ margin-right: 4px;
343
+ }
344
+
345
+ .rorvswild-local-panel__breakdown__value { font-weight: 700; }
346
+
347
+ .rorvswild-local-panel__details__section {
246
348
  padding: 12px 12px 11px !important;
247
349
  border-bottom: 1px solid rgb(26 29 36) !important;
248
350
  display: block !important;
249
351
  }
250
352
 
251
- .rorvswild-local-panel__request-details__section:hover {
353
+ .rorvswild-local-panel__details__section:hover {
252
354
  background: rgb(26 29 36) !important;
253
355
  transition: all .3s !important;
254
356
  }
255
357
 
256
- .rorvswild-local-panel__request-details__section__main {
358
+ .rorvswild-local-panel__details__section__main {
257
359
  display: flex !important;
258
360
  gap: 8px;
259
361
  width: 100% !important;
260
362
  flex-wrap: wrap !important;
261
363
  }
262
364
 
263
- .rorvswild-local-panel__request-details__section__file {
365
+ .rorvswild-local-panel__details__section__file {
264
366
  width: 100% !important;
265
367
  word-break: break-all !important;
266
368
  overflow-wrap: break-word !important;
@@ -270,16 +372,19 @@ h2.rorvswild-local-panel__request__name__title {
270
372
  gap: 8px;
271
373
  }
272
374
 
273
- a.rorvswild-local-panel__request-details__section__file__name {
375
+ a.rorvswild-local-panel__file__name {
274
376
  text-decoration-color: rgb(146 149 159);
275
377
  font-weight: 700;
276
378
  text-decoration-thickness: 1px;
277
379
  text-underline-offset: 1px;
278
380
  }
279
381
 
280
- a.rorvswild-local-panel__request-details__section__file__name:hover { text-decoration-color: rgb(199 203 214); }
382
+ a.rorvswild-local-panel__file__name:hover {
383
+ color: rgb(223 228 242) !important;
384
+ text-decoration-color: rgb(199 203 214);
385
+ }
281
386
 
282
- a.rorvswild-local-panel__request-details__section__file__name::after {
387
+ a.rorvswild-local-panel__file__name::after {
283
388
  content: '↗';
284
389
  text-decoration: none;
285
390
  display: inline-block;
@@ -287,15 +392,15 @@ a.rorvswild-local-panel__request-details__section__file__name::after {
287
392
  opacity: 0.5;
288
393
  }
289
394
 
290
- a.rorvswild-local-panel__request-details__section__file__name:hover::after { opacity: 1; }
395
+ a.rorvswild-local-panel__file__name:hover::after { opacity: 1; }
291
396
 
292
- .rorvswild-local-panel__request-details__section__file__name span {
397
+ .rorvswild-local-panel__file__name span {
293
398
  background: rgb(38 41 49);
294
399
  text-decoration: none;
295
400
  display: inline-block;
296
401
  }
297
402
 
298
- .rorvswild-local-panel__request-details__section__average {
403
+ .rorvswild-local-panel__details__section__average {
299
404
  color: rgb(182 202 255) !important;
300
405
  font-weight: 700 !important;
301
406
  width: 48px !important;
@@ -303,20 +408,20 @@ a.rorvswild-local-panel__request-details__section__file__name:hover::after { opa
303
408
  margin-left: auto;
304
409
  }
305
410
 
306
- .rorvswild-local-panel__request-details__section__calls {
411
+ .rorvswild-local-panel__details__section__calls {
307
412
  color: rgb(199 203 214) !important;
308
413
  width: 48px !important;
309
414
  text-align: right;
310
415
  }
311
416
 
312
- .rorvswild-local-panel__request-details__section__impact {
417
+ .rorvswild-local-panel__details__section__impact {
313
418
  color: rgb(199 203 214) !important;
314
419
  width: 48px !important;
315
420
  font-weight: 700 !important;
316
421
  text-align: right;
317
422
  }
318
423
 
319
- .rorvswild-local-panel__request-details__section__code {
424
+ .rorvswild-local-panel__details__section__code {
320
425
  color: rgb(146 149 159) !important;
321
426
  background: rgb(14 15 20);
322
427
  padding: 12px;
@@ -325,7 +430,40 @@ a.rorvswild-local-panel__request-details__section__file__name:hover::after { opa
325
430
  display: none;
326
431
  }
327
432
 
328
- .rorvswild-local-panel__request-details__section__kind {
433
+ .rorvswild-local-panel__details__section__code dl {
434
+ display: flex;
435
+ align-items: baseline;
436
+ justify-content: flex-end;
437
+ flex-wrap: wrap;
438
+ margin: 0;
439
+ padding: 0;
440
+ text-align: right;
441
+ gap: 12px 24px;
442
+ }
443
+
444
+ .rorvswild-local-panel__details__section__code dt {
445
+ white-space: nowrap;
446
+ margin: 0;
447
+ text-transform: uppercase;
448
+ letter-spacing: 1px;
449
+ font-size: 9px !important;
450
+ }
451
+
452
+ .rorvswild-local-panel__details__section__code dd {
453
+ margin: 0;
454
+ color: rgb(182 202 255) !important;
455
+ font-weight: 700;
456
+ }
457
+
458
+ .rorvswild-local-panel__details__section__code dd.dd--calls {
459
+ color: rgb(199 203 214) !important;
460
+ }
461
+
462
+ .rorvswild-local-panel__details__section__code dl + pre[class*="language-"] {
463
+ margin-top: 12px !important;
464
+ }
465
+
466
+ .rorvswild-local-panel__details__section__kind {
329
467
  background: rgb(38 41 49);
330
468
  font-size: 10px !important;
331
469
  text-transform: uppercase !important;
@@ -339,23 +477,27 @@ a.rorvswild-local-panel__request-details__section__file__name:hover::after { opa
339
477
  flex-shrink: 0;
340
478
  }
341
479
 
342
- button.rorvswild-local-panel__request-details__section__kind {
343
- box-shadow: 0 0 0 1px rgb(72 75 80) inset;
344
- border: none;
345
- font-weight: 700;
346
- position: relative;
480
+ button.rorvswild-local-panel__details__section__kind {
481
+ box-shadow: 0 0 0 1px rgb(72 75 80) inset !important;
482
+ border: none !important;
483
+ font-weight: 700 !important;
484
+ position: relative !important;
485
+ cursor: pointer !important;
347
486
  }
348
487
 
349
- button.rorvswild-local-panel__request-details__section__kind span {
488
+ button.rorvswild-local-panel__details__section__kind span {
350
489
  display: inline-block;
351
490
  max-width: calc(5ch + 5px);
352
491
  white-space: nowrap;
353
492
  overflow: hidden;
354
493
  }
355
494
 
356
- button.rorvswild-local-panel__request-details__section__kind:hover { box-shadow: 0 0 0 1px rgb(147 149 156) inset; }
495
+ button.rorvswild-local-panel__details__section__kind:hover {
496
+ box-shadow: 0 0 0 1px rgb(147 149 156) inset;
497
+ background-color: rgb(14 15 20) !important;
498
+ }
357
499
 
358
- button.rorvswild-local-panel__request-details__section__kind::after {
500
+ button.rorvswild-local-panel__details__section__kind::after {
359
501
  content: "";
360
502
  display: block;
361
503
  box-sizing: border-box;
@@ -369,28 +511,88 @@ button.rorvswild-local-panel__request-details__section__kind::after {
369
511
  top:calc(50% - 3px);
370
512
  }
371
513
 
372
- button.rorvswild-local-panel__request-details__section__kind:hover::after { border-color: inherit; }
514
+ button.rorvswild-local-panel__details__section__kind:hover::after { border-color: inherit; }
373
515
 
374
- span.rorvswild-local-panel__request-details__section__kind {
516
+ span.rorvswild-local-panel__details__section__kind {
375
517
  background: rgb(14 15 20) !important;
376
518
  color: rgb(146 149 159)!important;
377
519
  }
378
520
 
379
- .rorvswild-local-panel__request-details__section.is-open .rorvswild-local-panel__request-details__section__code {
380
- display: flex;
521
+ .rorvswild-local-panel__details__section.is-open .rorvswild-local-panel__details__section__code {
522
+ display: block;
381
523
  border-bottom: 1px solid rgb(26 29 36) !important
382
524
  }
383
525
 
384
- .rorvswild-local-panel__request-details__section.is-open .rorvswild-local-panel__request-details__section__kind {
526
+ .rorvswild-local-panel__details__section.is-open .rorvswild-local-panel__details__section__kind {
385
527
  color: rgb(182 202 255) !important;
386
528
  background-color: rgb(14 15 20) !important;
387
529
  }
388
530
 
389
- .rorvswild-local-panel__request-details__section.is-open .rorvswild-local-panel__request-details__section__kind::after {
531
+ .rorvswild-local-panel__details__section.is-open .rorvswild-local-panel__details__section__kind::after {
390
532
  transform: rotate(225deg);
391
533
  transform-origin: 2.5px 3px;
392
534
  }
393
535
 
536
+ .rorvswild-local-panel__card {
537
+ padding: 12px;
538
+ border: 1px solid rgb(26 29 36) !important;
539
+ }
540
+
541
+ .rorvswild-local-panel__card + .rorvswild-local-panel__card {
542
+ margin-top: 24px;
543
+ }
544
+
545
+ .rorvswild-local-panel__card__title {
546
+ color: rgb(146 149 159) !important;
547
+ text-align: center;
548
+ text-transform: uppercase;
549
+ font-size: 10px !important;
550
+ letter-spacing: 1px;
551
+ margin: 0 !important;
552
+ padding: 0 0 12px !important;
553
+ line-height: 24px !important;
554
+ }
555
+
556
+ .rorvswild-local-panel__card > * + * {
557
+ margin-top: 12px;
558
+ }
559
+
560
+ .rorvswild-local-panel__card summary:hover {
561
+ cursor: pointer;
562
+ color: rgb(223 228 242) !important;
563
+ }
564
+
565
+ .rorvswild-local-panel__card dl {
566
+ padding: 0;
567
+ margin: 0 -12px -12px;
568
+ }
569
+
570
+ .rorvswild-local-panel__card dl div {
571
+ display: grid;
572
+ grid-template-columns: 112px auto;
573
+ padding: 12px;
574
+ }
575
+
576
+ .rorvswild-local-panel__card dl div:hover {
577
+ background:rgb(26 29 36);
578
+ }
579
+
580
+ .rorvswild-local-panel__card dl div + div {
581
+ border-top: 1px solid rgb(26 29 36);
582
+ }
583
+
584
+ .rorvswild-local-panel__card dt {
585
+ color: rgb(146 149 159) !important;
586
+ text-transform: uppercase;
587
+ font-size: 10px !important;
588
+ letter-spacing: 1px;
589
+ }
590
+
591
+ .rorvswild-local-panel__card dd {
592
+ word-break: break-all !important;
593
+ overflow-wrap: break-word !important;
594
+ }
595
+
394
596
  /* Panel Footer */
395
597
  .rorvswild-local-panel__footer {
396
598
  width: 100% !important;
@@ -407,15 +609,15 @@ a.rorvswild-local-panel__footer__link {
407
609
  }
408
610
 
409
611
  @media screen and (min-width: 720px) {
410
- .rorvswild-local-panel__request-details__section__main { flex-wrap: nowrap !important; }
612
+ .rorvswild-local-panel__details__section__main { flex-wrap: nowrap !important; }
411
613
 
412
- .rorvswild-local-panel__request__name,
413
- .rorvswild-local-panel__request-details__section__file { flex: 1 !important; }
614
+ .rorvswild-local-panel__name,
615
+ .rorvswild-local-panel__details__section__file { flex: 1 !important; }
414
616
 
415
- .rorvswild-local-panel__request__runtime { margin-left: 12px !important; }
617
+ .rorvswild-local-panel__runtime { margin-left: 12px !important; }
416
618
 
417
619
  .rorvswild-local-panel__width-limiter {
418
620
  max-width: 1520px;
419
621
  margin: 0 auto;
420
622
  }
421
- }
623
+ }
@@ -18,7 +18,7 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
18
18
  line-height: 24px !important;
19
19
  font-weight: 300 !important;
20
20
 
21
- white-space: pre-line !important;
21
+ white-space: pre-wrap !important;
22
22
  word-wrap: break-word !important;
23
23
  word-break: keep-all !important;
24
24
 
@@ -4,8 +4,8 @@ require "rorvswild/local/queue"
4
4
  module RorVsWild
5
5
  module Local
6
6
  def self.start(config = {})
7
- Rails.application.config.middleware.unshift(RorVsWild::Local::Middleware, nil)
8
7
  RorVsWild.start(config.merge(queue: RorVsWild::Local::Queue.new))
8
+ Rails.application.config.middleware.unshift(RorVsWild::Local::Middleware, nil)
9
9
  end
10
10
  end
11
11
  end
@@ -22,7 +22,7 @@ module RorVsWild
22
22
  if method_name = controller.send(:method_for_action, controller.action_name)
23
23
  section.file, section.line = controller.method(method_name).source_location
24
24
  section.file = RorVsWild.agent.locator.relative_path(section.file)
25
- section.command = "#{controller.class}##{method_name}"
25
+ section.commands << "#{controller.class}##{method_name}"
26
26
  end
27
27
  RorVsWild.agent.current_data[:name] = controller_action if RorVsWild.agent.current_data
28
28
  end
@@ -14,7 +14,7 @@ module RorVsWild
14
14
 
15
15
  def finish(name, id, payload)
16
16
  RorVsWild::Section.stop do |section|
17
- section.command = payload[:mailer]
17
+ section.commands << payload[:mailer]
18
18
  section.kind = "mail".freeze
19
19
  end
20
20
  end
@@ -16,7 +16,7 @@ module RorVsWild
16
16
  def finish(name, id, payload)
17
17
  RorVsWild::Section.stop do |section|
18
18
  section.kind = "view".freeze
19
- section.command = RorVsWild.agent.locator.relative_path(payload[:identifier])
19
+ section.commands << RorVsWild.agent.locator.relative_path(payload[:identifier])
20
20
  section.file = section.command
21
21
  section.line = 1
22
22
  end
@@ -12,7 +12,7 @@ module RorVsWild
12
12
  RorVsWild.agent.measure_job(job.class.name, parameters: job.arguments) do
13
13
  begin
14
14
  section = RorVsWild::Section.start
15
- section.command = "#{job.class}#perform"
15
+ section.commands << "#{job.class}#perform"
16
16
  section.file, section.line = job.method(:perform).source_location
17
17
  section.file = RorVsWild.agent.locator.relative_path(section.file)
18
18
  block.call
@@ -15,13 +15,11 @@ module RorVsWild
15
15
  end
16
16
 
17
17
  IGNORED_QUERIES = %w[EXPLAIN SCHEMA].freeze
18
- APPENDABLE_QUERIES = ["BEGIN", "COMMIT"].freeze
19
18
 
20
19
  def start(name, id, payload)
21
20
  return if IGNORED_QUERIES.include?(payload[:name])
22
21
  RorVsWild::Section.start do |section|
23
- section.appendable_command = APPENDABLE_QUERIES.include?(payload[:sql])
24
- section.command = normalize_sql_query(payload[:sql])
22
+ section.commands << normalize_sql_query(payload[:sql])
25
23
  section.kind = "sql"
26
24
  end
27
25
  end
@@ -18,7 +18,7 @@ module RorVsWild
18
18
  RorVsWild.agent.current_data[:path] = env["ORIGINAL_FULLPATH"]
19
19
  section = RorVsWild::Section.start
20
20
  section.file, section.line = rails_engine_location
21
- section.command = "Rails::Engine#call"
21
+ section.commands << "Rails::Engine#call"
22
22
  code, headers, body = @app.call(env)
23
23
  [code, headers, body]
24
24
  ensure
@@ -35,21 +35,21 @@ module RorVsWild
35
35
  def format_server_timing_header(sections)
36
36
  sections.map do |section|
37
37
  if section.kind == "view"
38
- "#{section.kind};dur=#{section.self_runtime};desc=\"#{section.file}\""
38
+ "#{section.kind};dur=#{section.self_ms.round};desc=\"#{section.file}\""
39
39
  else
40
- "#{section.kind};dur=#{section.self_runtime};desc=\"#{section.file}:#{section.line}\""
40
+ "#{section.kind};dur=#{section.self_ms.round};desc=\"#{section.file}:#{section.line}\""
41
41
  end
42
42
  end.join(", ")
43
43
  end
44
44
 
45
45
  def format_server_timing_ascii(sections, total_width = 80)
46
- max_time = sections.map(&:self_runtime).max
46
+ max_time = sections.map(&:self_ms).max
47
47
  chart_width = (total_width * 0.25).to_i
48
48
  rows = sections.map { |section|
49
49
  [
50
50
  section.kind == "view" ? section.file : "#{section.file}:#{section.line}",
51
- "█" * (section.self_runtime * (chart_width-1) / max_time),
52
- "#{section.self_runtime}ms"
51
+ "█" * (section.self_ms * (chart_width-1) / max_time),
52
+ "%.1fms" % section.self_ms,
53
53
  ]
54
54
  }
55
55
  time_width = rows.map { |cols| cols[2].size }.max + 1
@@ -65,7 +65,7 @@ module RorVsWild
65
65
 
66
66
  def inject_server_timing(data, headers)
67
67
  return if !data || !data[:send_server_timing] || !(sections = data[:sections])
68
- sections = sections.sort_by(&:self_runtime).reverse[0,10]
68
+ sections = sections.sort_by(&:self_ms).reverse[0,10]
69
69
  headers["Server-Timing"] = format_server_timing_header(sections)
70
70
  if data[:name] && RorVsWild.logger.level <= Logger::Severity::DEBUG
71
71
  RorVsWild.logger.debug(["┤ #{data[:name]} ├".center(80, "─"),
@@ -15,8 +15,7 @@ module RorVsWild
15
15
  module V4
16
16
  def process(commands, &block)
17
17
  string = commands.map(&:first).join("\n")
18
- appendable = APPENDABLE_COMMANDS.include?(commands[0][0])
19
- RorVsWild.agent.measure_section(string, appendable_command: appendable, kind: "redis") do
18
+ RorVsWild.agent.measure_section(string, kind: "redis") do
20
19
  super(commands, &block)
21
20
  end
22
21
  end
@@ -24,8 +23,7 @@ module RorVsWild
24
23
 
25
24
  module V5
26
25
  def send_command(command, &block)
27
- appendable = APPENDABLE_COMMANDS.include?(command)
28
- RorVsWild.agent.measure_section(command[0], appendable_command: appendable, kind: "redis") do
26
+ RorVsWild.agent.measure_section(command[0], kind: "redis") do
29
27
  super(command, &block)
30
28
  end
31
29
  end
@@ -38,8 +36,6 @@ module RorVsWild
38
36
  RorVsWild.agent.measure_section("multi", kind: "redis") { super }
39
37
  end
40
38
  end
41
-
42
- APPENDABLE_COMMANDS = [:auth, :select]
43
39
  end
44
40
  end
45
41
  end
@@ -27,6 +27,10 @@ module RorVsWild
27
27
  push_to(requests, data) if !@request_sampling_rate || rand <= @request_sampling_rate
28
28
  end
29
29
 
30
+ def push_error(data)
31
+ client.post_async("/errors", error: data)
32
+ end
33
+
30
34
  def push_to(array, data)
31
35
  mutex.synchronize do
32
36
  wakeup_thread if array.push(data).size >= FLUSH_TRESHOLD || !thread