@@ -50,7 +50,8 @@ export function transformDoc(harData: Har): WaterfallDocs {
50
50
* @param {boolean } isTLS
51
51
*/
52
52
function toWaterFallEntry ( entry : Entry , index : number , startRelative : number , isTLS : boolean ) {
53
- const endRelative = toInt ( entry . _all_end ) || ( startRelative + entry . time ) ;
53
+ startRelative = Math . round ( startRelative ) ;
54
+ const endRelative = Math . round ( toInt ( entry . _all_end ) || ( startRelative + entry . time ) ) ;
54
55
const requestType = mimeToRequestType ( entry . response . content . mimeType ) ;
55
56
const indicators = collectIndicators ( entry , isTLS , requestType ) ;
56
57
const responseDetails = createResponseDetails ( entry , indicators ) ;
@@ -168,11 +169,11 @@ function buildDetailTimingBlocks(startRelative: number, harEntry: Entry): Waterf
168
169
const sslEnd = parseInt ( harEntry [ `_ssl_end` ] , 10 ) || time . start + t . ssl ;
169
170
const connectStart = ( ! ! parseInt ( harEntry [ `_ssl_start` ] , 10 ) ) ? time . start : sslEnd ;
170
171
return collect
171
- . concat ( [ createWaterfallEntryTiming ( "ssl" , sslStart , sslEnd ) ] )
172
- . concat ( [ createWaterfallEntryTiming ( key , connectStart , time . end ) ] ) ;
172
+ . concat ( [ createWaterfallEntryTiming ( "ssl" , Math . round ( sslStart ) , Math . round ( sslEnd ) ) ] )
173
+ . concat ( [ createWaterfallEntryTiming ( key , Math . round ( connectStart ) , Math . round ( time . end ) ) ] ) ;
173
174
}
174
175
175
- return collect . concat ( [ createWaterfallEntryTiming ( key , time . start , time . end ) ] ) ;
176
+ return collect . concat ( [ createWaterfallEntryTiming ( key , Math . round ( time . start ) , Math . round ( time . end ) ) ] ) ;
176
177
} , [ ] ) ;
177
178
}
178
179
@@ -199,8 +200,8 @@ function getTimePair(key: string, harEntry: Entry, collect: WaterfallEntryTiming
199
200
const end = isNaN ( preciseEnd ) ? ( start + harEntry . timings [ key ] ) : preciseEnd ;
200
201
201
202
return {
202
- "end" : end ,
203
- "start" : start ,
203
+ "end" : Math . round ( end ) ,
204
+ "start" : Math . round ( start ) ,
204
205
} ;
205
206
}
206
207
0 commit comments