@@ -23,7 +23,11 @@ import {
2323} from '../../model/events/categorization' ;
2424
2525import { UnreachableCheck } from '../../util/error' ;
26- import { getReadableSize } from '../../model/events/bodies' ;
26+ import {
27+ getReadableSize ,
28+ sigFig
29+ } from '../../model/events/bodies' ;
30+
2731import { filterProps } from '../component-utils' ;
2832
2933import { EmptyState } from '../common/empty-state' ;
@@ -166,6 +170,18 @@ const PathAndQuery = styled(Column)`
166170 flex-basis: 1000px;
167171` ;
168172
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+
169185// Match Method + Status, but shrink right margin slightly so that
170186// spinner + "WebRTC Media" fits OK.
171187const EventTypeColumn = styled ( Column ) `
@@ -372,6 +388,10 @@ const ExchangeRow = observer(({
372388 category
373389 } = exchange ;
374390
391+ let durationMs = ( 'startTime' in exchange . timingEvents ) ? (
392+ ( exchange . timingEvents . responseSentTimestamp || exchange . timingEvents . abortedTimestamp || 0 ) - exchange . timingEvents . startTimestamp
393+ ) : 0 ;
394+
375395 return < TrafficEventListRow
376396 role = "row"
377397 aria-label = 'row'
@@ -420,6 +440,18 @@ const ExchangeRow = observer(({
420440 < PathAndQuery title = { request . parsedUrl . pathname + request . parsedUrl . search } >
421441 { request . parsedUrl . pathname + request . parsedUrl . search }
422442 </ 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 >
423455 </ TrafficEventListRow > ;
424456} ) ;
425457
@@ -666,6 +698,8 @@ export class ViewEventList extends React.Component<ViewEventListProps> {
666698 < Source > Source</ Source >
667699 < Host > Host</ Host >
668700 < PathAndQuery > Path and query</ PathAndQuery >
701+ < Duration > Duration</ Duration >
702+ < Size > Size</ Size >
669703 </ TableHeader >
670704
671705 {
@@ -869,4 +903,4 @@ export class ViewEventList extends React.Component<ViewEventListProps> {
869903
870904 event . preventDefault ( ) ;
871905 }
872- }
906+ }
0 commit comments