@@ -23,7 +23,11 @@ import {
23
23
} from '../../model/events/categorization' ;
24
24
25
25
import { UnreachableCheck } from '../../util/error' ;
26
- import { getReadableSize } from '../../model/events/bodies' ;
26
+ import {
27
+ getReadableSize ,
28
+ sigFig
29
+ } from '../../model/events/bodies' ;
30
+
27
31
import { filterProps } from '../component-utils' ;
28
32
29
33
import { EmptyState } from '../common/empty-state' ;
@@ -166,6 +170,18 @@ const PathAndQuery = styled(Column)`
166
170
flex-basis: 1000px;
167
171
` ;
168
172
173
+ const Duration = styled ( Column ) `
174
+ flex-basis: 80px;
175
+ flex-shrink: 0;
176
+ flex-grow: 0;
177
+ ` ;
178
+
179
+ const Size = styled ( Column ) `
180
+ flex-basis: 80px;
181
+ flex-shrink: 0;
182
+ flex-grow: 0;
183
+ ` ;
184
+
169
185
// Match Method + Status, but shrink right margin slightly so that
170
186
// spinner + "WebRTC Media" fits OK.
171
187
const EventTypeColumn = styled ( Column ) `
@@ -372,6 +388,10 @@ const ExchangeRow = observer(({
372
388
category
373
389
} = exchange ;
374
390
391
+ let durationMs = ( 'startTime' in exchange . timingEvents ) ? (
392
+ ( exchange . timingEvents . responseSentTimestamp || exchange . timingEvents . abortedTimestamp || 0 ) - exchange . timingEvents . startTimestamp
393
+ ) : 0 ;
394
+
375
395
return < TrafficEventListRow
376
396
role = "row"
377
397
aria-label = 'row'
@@ -420,6 +440,18 @@ const ExchangeRow = observer(({
420
440
< PathAndQuery title = { request . parsedUrl . pathname + request . parsedUrl . search } >
421
441
{ request . parsedUrl . pathname + request . parsedUrl . search }
422
442
</ PathAndQuery >
443
+ < Duration >
444
+ { durationMs > 0
445
+ ? (
446
+ ( durationMs < 100 ) ?
447
+ ( sigFig ( durationMs , 2 ) + 'ms' ) :
448
+ ( durationMs < 1000 ? sigFig ( durationMs , 1 ) + 'ms' : ( durationMs < 10000 ? sigFig ( durationMs / 1000 , 3 ) + ' s' : sigFig ( durationMs / 1000 , 1 ) + ' s' ) )
449
+ )
450
+ : '' }
451
+ </ Duration >
452
+ < Size >
453
+ { exchange . isSuccessfulExchange ( ) ? getReadableSize ( exchange . response . body . encoded . byteLength ) : '' }
454
+ </ Size >
423
455
</ TrafficEventListRow > ;
424
456
} ) ;
425
457
@@ -666,6 +698,8 @@ export class ViewEventList extends React.Component<ViewEventListProps> {
666
698
< Source > Source</ Source >
667
699
< Host > Host</ Host >
668
700
< PathAndQuery > Path and query</ PathAndQuery >
701
+ < Duration > Duration</ Duration >
702
+ < Size > Size</ Size >
669
703
</ TableHeader >
670
704
671
705
{
@@ -869,4 +903,4 @@ export class ViewEventList extends React.Component<ViewEventListProps> {
869
903
870
904
event . preventDefault ( ) ;
871
905
}
872
- }
906
+ }
0 commit comments