author | Arun Kumar Mohan <arunmohandm@gmail.com> |
Tue, 06 Aug 2019 12:02:21 +0000 | |
changeset 486518 | ee032bb4df373fd372437bd56e188efcd2841493 |
parent 486517 | 38858836957c80983a245ab0d0208fb12e73287f |
child 486519 | a63bc377424440cc3bb358644eed3420f73dcfad |
push id | 91764 |
push user | nchevobbe@mozilla.com |
push date | Tue, 06 Aug 2019 12:03:00 +0000 |
treeherder | autoland@ee032bb4df37 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | nchevobbe |
bugs | 1566469 |
milestone | 70.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/devtools/client/netmonitor/src/components/RequestListColumnTime.js +++ b/devtools/client/netmonitor/src/components/RequestListColumnTime.js @@ -24,17 +24,17 @@ const { * - Response Time * - Duration Time * - Latency Time */ class RequestListColumnTime extends Component { static get propTypes() { return { connector: PropTypes.object.isRequired, - firstRequestStartedMillis: PropTypes.number.isRequired, + firstRequestStartedMs: PropTypes.number.isRequired, item: PropTypes.object.isRequired, type: PropTypes.oneOf(["start", "end", "response", "duration", "latency"]) .isRequired, }; } componentDidMount() { const { item, connector } = this.props; @@ -46,25 +46,25 @@ class RequestListColumnTime extends Comp fetchNetworkUpdatePacket(connector.requestData, item, ["eventTimings"]); } shouldComponentUpdate(nextProps) { return this.getTime(this.props) !== this.getTime(nextProps); } getTime(props) { - const { firstRequestStartedMillis, item, type } = props; + const { firstRequestStartedMs, item, type } = props; switch (type) { case "start": - return getStartTime(item, firstRequestStartedMillis); + return getStartTime(item, firstRequestStartedMs); case "end": - return getEndTime(item, firstRequestStartedMillis); + return getEndTime(item, firstRequestStartedMs); case "response": - return getResponseTime(item, firstRequestStartedMillis); + return getResponseTime(item, firstRequestStartedMs); case "duration": return item.totalTime; case "latency": return item.eventTimings ? item.eventTimings.timings.wait : undefined; } return 0; }
--- a/devtools/client/netmonitor/src/components/RequestListColumnWaterfall.js +++ b/devtools/client/netmonitor/src/components/RequestListColumnWaterfall.js @@ -25,17 +25,17 @@ const UPDATED_WATERFALL_PROPS = [ "fromServiceWorker", "totalTime", ]; class RequestListColumnWaterfall extends Component { static get propTypes() { return { connector: PropTypes.object.isRequired, - firstRequestStartedMillis: PropTypes.number.isRequired, + firstRequestStartedMs: PropTypes.number.isRequired, item: PropTypes.object.isRequired, onWaterfallMouseDown: PropTypes.func.isRequired, }; } componentDidMount() { const { connector, item } = this.props; fetchNetworkUpdatePacket(connector.requestData, item, ["eventTimings"]); @@ -47,19 +47,17 @@ class RequestListColumnWaterfall extends } shouldComponentUpdate(nextProps) { return ( !propertiesEqual( UPDATED_WATERFALL_PROPS, this.props.item, nextProps.item - ) || - this.props.firstRequestStartedMillis !== - nextProps.firstRequestStartedMillis + ) || this.props.firstRequestStartedMs !== nextProps.firstRequestStartedMs ); } timingTooltip() { const { eventTimings, fromCache, fromServiceWorker, @@ -137,37 +135,32 @@ class RequestListColumnWaterfall extends ) ); } return boxes; } render() { - const { - firstRequestStartedMillis, - item, - onWaterfallMouseDown, - } = this.props; + const { firstRequestStartedMs, item, onWaterfallMouseDown } = this.props; return dom.td( { className: "requests-list-column requests-list-waterfall", onMouseOver: ({ target }) => { if (!target.title) { target.title = this.timingTooltip(); } }, }, div( { className: "requests-list-timings", style: { - paddingInlineStart: `${item.startedMillis - - firstRequestStartedMillis}px`, + paddingInlineStart: `${item.startedMs - firstRequestStartedMs}px`, }, onMouseDown: onWaterfallMouseDown, }, this.timingBoxes() ) ); } }
--- a/devtools/client/netmonitor/src/components/RequestListContent.js +++ b/devtools/client/netmonitor/src/components/RequestListContent.js @@ -69,17 +69,17 @@ class RequestListContent extends Compone networkDetailsOpen: PropTypes.bool.isRequired, networkDetailsWidth: PropTypes.number, networkDetailsHeight: PropTypes.number, cloneRequest: PropTypes.func.isRequired, clickedRequest: PropTypes.object, openDetailsPanelTab: PropTypes.func.isRequired, sendCustomRequest: PropTypes.func.isRequired, displayedRequests: PropTypes.array.isRequired, - firstRequestStartedMillis: PropTypes.number.isRequired, + firstRequestStartedMs: PropTypes.number.isRequired, fromCache: PropTypes.bool, onCauseBadgeMouseDown: PropTypes.func.isRequired, onItemRightMouseButtonDown: PropTypes.func.isRequired, onItemMouseDown: PropTypes.func.isRequired, onSecurityIconMouseDown: PropTypes.func.isRequired, onSelectDelta: PropTypes.func.isRequired, onWaterfallMouseDown: PropTypes.func.isRequired, openStatistics: PropTypes.func.isRequired, @@ -334,17 +334,17 @@ class RequestListContent extends Compone this.shouldScrollBottom = false; } render() { const { connector, columns, displayedRequests, - firstRequestStartedMillis, + firstRequestStartedMs, onCauseBadgeMouseDown, onSecurityIconMouseDown, onWaterfallMouseDown, requestFilterTypes, scale, selectedRequest, } = this.props; @@ -367,17 +367,17 @@ class RequestListContent extends Compone style: { "--timings-scale": scale, "--timings-rev-scale": 1 / scale, }, }, displayedRequests.map((item, index) => RequestListItem({ blocked: !!item.blockedReason, - firstRequestStartedMillis, + firstRequestStartedMs, fromCache: item.status === "304" || item.fromCache, connector, columns, item, index, isSelected: item.id === (selectedRequest && selectedRequest.id), key: item.id, onContextMenu: this.onContextMenu, @@ -401,17 +401,17 @@ class RequestListContent extends Compone module.exports = connect( state => ({ columns: state.ui.columns, networkDetailsOpen: state.ui.networkDetailsOpen, networkDetailsWidth: state.ui.networkDetailsWidth, networkDetailsHeight: state.ui.networkDetailsHeight, clickedRequest: state.requests.clickedRequest, displayedRequests: getDisplayedRequests(state), - firstRequestStartedMillis: state.requests.firstStartedMillis, + firstRequestStartedMs: state.requests.firstStartedMs, selectedRequest: getSelectedRequest(state), scale: getWaterfallScale(state), requestFilterTypes: state.filters.requestFilterTypes, }), (dispatch, props) => ({ blockSelectedRequestURL: clickedRequest => { dispatch( Actions.blockSelectedRequestURL(props.connector, clickedRequest)
--- a/devtools/client/netmonitor/src/components/RequestListHeader.js +++ b/devtools/client/netmonitor/src/components/RequestListHeader.js @@ -598,17 +598,17 @@ class RequestListHeader extends Componen ); } } module.exports = connect( state => ({ columns: state.ui.columns, columnsData: state.ui.columnsData, - firstRequestStartedMillis: state.requests.firstStartedMillis, + firstRequestStartedMs: state.requests.firstStartedMs, scale: getWaterfallScale(state), sort: state.sort, timingMarkers: state.timingMarkers, waterfallWidth: state.ui.waterfallWidth, }), dispatch => ({ resetColumns: () => dispatch(Actions.resetColumns()), resetSorting: () => dispatch(Actions.sortBy(null)),
--- a/devtools/client/netmonitor/src/components/RequestListItem.js +++ b/devtools/client/netmonitor/src/components/RequestListItem.js @@ -105,26 +105,26 @@ const UPDATED_REQ_ITEM_PROPS = [ "isRacing", "fromServiceWorker", "method", "url", "remoteAddress", "cause", "contentSize", "transferredSize", - "startedMillis", + "startedMs", "totalTime", "requestCookies", "requestHeaders", "responseCookies", "responseHeaders", ]; const UPDATED_REQ_PROPS = [ - "firstRequestStartedMillis", + "firstRequestStartedMs", "index", "isSelected", "requestFilterTypes", "waterfallWidth", ]; /** * Used by render: renders the given ColumnComponent if the flag for this column @@ -165,53 +165,53 @@ const COLUMN_COMPONENTS = [ ColumnComponent: RequestListColumnSetCookies, props: ["connector"], }, { column: "transferred", ColumnComponent: RequestListColumnTransferredSize }, { column: "contentSize", ColumnComponent: RequestListColumnContentSize }, { column: "startTime", ColumnComponent: RequestListColumnTime, - props: ["connector", "firstRequestStartedMillis", { type: "start" }], + props: ["connector", "firstRequestStartedMs", { type: "start" }], }, { column: "endTime", ColumnComponent: RequestListColumnTime, - props: ["connector", "firstRequestStartedMillis", { type: "end" }], + props: ["connector", "firstRequestStartedMs", { type: "end" }], }, { column: "responseTime", ColumnComponent: RequestListColumnTime, - props: ["connector", "firstRequestStartedMillis", { type: "response" }], + props: ["connector", "firstRequestStartedMs", { type: "response" }], }, { column: "duration", ColumnComponent: RequestListColumnTime, - props: ["connector", "firstRequestStartedMillis", { type: "duration" }], + props: ["connector", "firstRequestStartedMs", { type: "duration" }], }, { column: "latency", ColumnComponent: RequestListColumnTime, - props: ["connector", "firstRequestStartedMillis", { type: "latency" }], + props: ["connector", "firstRequestStartedMs", { type: "latency" }], }, ]; /** * Render one row in the request list. */ class RequestListItem extends Component { static get propTypes() { return { blocked: PropTypes.bool, connector: PropTypes.object.isRequired, columns: PropTypes.object.isRequired, item: PropTypes.object.isRequired, index: PropTypes.number.isRequired, isSelected: PropTypes.bool.isRequired, - firstRequestStartedMillis: PropTypes.number.isRequired, + firstRequestStartedMs: PropTypes.number.isRequired, fromCache: PropTypes.bool, onCauseBadgeMouseDown: PropTypes.func.isRequired, onDoubleClick: PropTypes.func.isRequired, onContextMenu: PropTypes.func.isRequired, onFocusedNodeChange: PropTypes.func, onMouseDown: PropTypes.func.isRequired, onSecurityIconMouseDown: PropTypes.func.isRequired, onWaterfallMouseDown: PropTypes.func.isRequired, @@ -270,17 +270,17 @@ class RequestListItem extends Component render() { const { blocked, connector, columns, item, index, isSelected, - firstRequestStartedMillis, + firstRequestStartedMs, fromCache, onDoubleClick, onContextMenu, onMouseDown, onWaterfallMouseDown, } = this.props; const classList = ["request-list-item", index % 2 ? "odd" : "even"]; @@ -321,17 +321,17 @@ class RequestListItem extends Component connector, item, header, }) ), columns.waterfall && RequestListColumnWaterfall({ connector, - firstRequestStartedMillis, + firstRequestStartedMs, item, onWaterfallMouseDown, }) ); } } module.exports = RequestListItem;
--- a/devtools/client/netmonitor/src/components/StatusBar.js +++ b/devtools/client/netmonitor/src/components/StatusBar.js @@ -33,22 +33,17 @@ const TOOLTIP_TRANSFERRED = L10N.getStr( "networkMenu.summary.tooltip.transferred" ); const TOOLTIP_FINISH = L10N.getStr("networkMenu.summary.tooltip.finish"); const TOOLTIP_DOM_CONTENT_LOADED = L10N.getStr( "networkMenu.summary.tooltip.domContentLoaded" ); const TOOLTIP_LOAD = L10N.getStr("networkMenu.summary.tooltip.load"); -const UPDATED_SUMMARY_PROPS = [ - "count", - "contentSize", - "transferredSize", - "millis", -]; +const UPDATED_SUMMARY_PROPS = ["count", "contentSize", "transferredSize", "ms"]; const UPDATED_TIMING_PROPS = ["DOMContentLoaded", "load"]; /** * Status Bar component * Displays the summary of total size and transferred size by all requests * Also displays different timing markers */ @@ -71,34 +66,34 @@ class StatusBar extends Component { timingMarkers, nextProps.timingMarkers ) ); } render() { const { openStatistics, summary, timingMarkers } = this.props; - const { count, contentSize, transferredSize, millis } = summary; + const { count, contentSize, transferredSize, ms } = summary; const { DOMContentLoaded, load } = timingMarkers; const countText = count === 0 ? REQUESTS_COUNT_EMPTY : PluralForm.get( count, L10N.getStr("networkMenu.summary.requestsCount2") ).replace("#1", count); const transferText = L10N.getFormatStrWithNumbers( "networkMenu.summary.transferred", getFormattedSize(contentSize), getFormattedSize(transferredSize) ); const finishText = L10N.getFormatStrWithNumbers( "networkMenu.summary.finish", - getFormattedTime(millis) + getFormattedTime(ms) ); return div( { className: "devtools-toolbar devtools-toolbar-bottom" }, button( { className: "devtools-button requests-list-network-summary-button", title: TOOLTIP_PERF,
--- a/devtools/client/netmonitor/src/components/websockets/StatusBar.js +++ b/devtools/client/netmonitor/src/components/websockets/StatusBar.js @@ -33,17 +33,17 @@ const TOOLTIP_FRAMES_COUNT = L10N.getStr ); const TOOLTIP_FRAMES_TOTAL_SIZE = L10N.getStr( "networkMenu.ws.summary.tooltip.framesTotalSize" ); const TOOLTIP_FRAMES_TOTAL_TIME = L10N.getStr( "networkMenu.ws.summary.tooltip.framesTotalTime" ); -const UPDATED_WS_SUMMARY_PROPS = ["count", "totalMillis", "totalSize"]; +const UPDATED_WS_SUMMARY_PROPS = ["count", "totalMs", "totalSize"]; /** * Displays the summary of frame count, total size and total time since the first frame. */ class StatusBar extends Component { static get propTypes() { return { summary: PropTypes.object.isRequired, @@ -56,27 +56,27 @@ class StatusBar extends Component { UPDATED_WS_SUMMARY_PROPS, summary, nextProps.summary ); } render() { const { summary } = this.props; - const { count, totalSize, totalMillis } = summary; + const { count, totalSize, totalMs } = summary; const countText = count === 0 ? FRAMES_COUNT_EMPTY : PluralForm.get( count, L10N.getStr("networkMenu.ws.summary.framesCount2") ).replace("#1", count); const totalSizeText = getFormattedSize(totalSize); - const totalMillisText = getFormattedTime(totalMillis); + const totalMillisText = getFormattedTime(totalMs); return footer( { className: "devtools-toolbar devtools-toolbar-bottom" }, div( { className: "status-bar-label frames-list-network-summary-count", title: TOOLTIP_FRAMES_COUNT, },
--- a/devtools/client/netmonitor/src/connector/chrome/events.js +++ b/devtools/client/netmonitor/src/connector/chrome/events.js @@ -212,17 +212,17 @@ class CDPConnector { fromCache, fromServiceWorker, } = data; this.actions .addRequest( id, { - startedMillis: startedDateTime, + startedMs: startedDateTime, method, url, isXHR, cause, fromCache, fromServiceWorker, }, true
--- a/devtools/client/netmonitor/src/connector/firefox-data-provider.js +++ b/devtools/client/netmonitor/src/connector/firefox-data-provider.js @@ -88,17 +88,17 @@ class FirefoxDataProvider { blockedReason, }); if (this.actionsEnabled && this.actions.addRequest) { await this.actions.addRequest( id, { // Convert the received date/time string to a unix timestamp. - startedMillis: Date.parse(startedDateTime), + startedMs: Date.parse(startedDateTime), method, url, isXHR, cause, // Compatibility code to support Firefox 58 and earlier that always // send stack-trace immediately on networkEvent message. // FF59+ supports fetching the traces lazily via requestData.
--- a/devtools/client/netmonitor/src/har/har-builder.js +++ b/devtools/client/netmonitor/src/har/har-builder.js @@ -96,17 +96,17 @@ HarBuilder.prototype = { return page; }, buildEntry: async function(log, file) { const page = this.getPage(log, file); const entry = {}; entry.pageref = page.id; - entry.startedDateTime = dateToJSON(new Date(file.startedMillis)); + entry.startedDateTime = dateToJSON(new Date(file.startedMs)); let eventTimings = file.eventTimings; if (!eventTimings && this._options.requestData) { eventTimings = await this._options.requestData(file.id, "eventTimings"); } entry.request = await this.buildRequest(file); entry.response = await this.buildResponse(file);
--- a/devtools/client/netmonitor/src/har/har-collector.js +++ b/devtools/client/netmonitor/src/har/har-collector.js @@ -179,18 +179,18 @@ HarCollector.prototype = { if (file) { console.error( "HarCollector.onNetworkEvent; ERROR " + "existing file conflict!" ); return; } file = { - startedDeltaMillis: startTime - this.firstRequestStart, - startedMillis: startTime, + startedDeltaMs: startTime - this.firstRequestStart, + startedMs: startTime, method: method, url: url, isXHR: isXHR, }; this.files.set(actor, file); // Mimic the Net panel data structure
--- a/devtools/client/netmonitor/src/har/har-importer.js +++ b/devtools/client/netmonitor/src/har/har-importer.js @@ -33,23 +33,23 @@ HarImporter.prototype = { const pages = new Map(); har.log.pages.forEach(page => { pages.set(page.id, page); }); // Iterate all entries/requests and generate state. har.log.entries.forEach(entry => { const requestId = String(++guid); - const startedMillis = Date.parse(entry.startedDateTime); + const startedMs = Date.parse(entry.startedDateTime); // Add request this.actions.addRequest( requestId, { - startedMillis: startedMillis, + startedMs: startedMs, method: entry.request.method, url: entry.request.url, isXHR: false, cause: { loadingDocumentUri: "", stackTraceAvailable: false, type: "", }, @@ -136,24 +136,24 @@ HarImporter.prototype = { // Set 0 as the default value onContentLoad = onContentLoad != -1 ? onContentLoad : 0; onLoad = onLoad != -1 ? onLoad : 0; // Add timing markers if (onContentLoad > 0) { this.actions.addTimingMarker({ name: "dom-interactive", - time: startedMillis + onContentLoad, + time: startedMs + onContentLoad, }); } if (onLoad > 0) { this.actions.addTimingMarker({ name: "dom-complete", - time: startedMillis + onLoad, + time: startedMs + onLoad, }); } }); }, }; // Exports from this module exports.HarImporter = HarImporter;
--- a/devtools/client/netmonitor/src/reducers/requests.js +++ b/devtools/client/netmonitor/src/reducers/requests.js @@ -32,18 +32,18 @@ function Requests() { // Map with all requests (key = actor ID, value = request object) requests: new Map(), // Selected request ID selectedId: null, preselectedId: null, // True if the monitor is recording HTTP traffic recording: true, // Auxiliary fields to hold requests stats - firstStartedMillis: +Infinity, - lastEndedMillis: -Infinity, + firstStartedMs: +Infinity, + lastEndedMs: -Infinity, }; } /** * This reducer is responsible for maintaining list of request * within the Network panel. */ function requestsReducer(state = Requests(), action) { @@ -147,54 +147,53 @@ function addRequest(state, action) { id: action.id, ...action.data, urlDetails: getUrlDetails(action.data.url), }; nextState.requests = mapSet(state.requests, newRequest.id, newRequest); // Update the started/ended timestamps. - const { startedMillis } = action.data; - if (startedMillis < state.firstStartedMillis) { - nextState.firstStartedMillis = startedMillis; + const { startedMs } = action.data; + if (startedMs < state.firstStartedMs) { + nextState.firstStartedMs = startedMs; } - if (startedMillis > state.lastEndedMillis) { - nextState.lastEndedMillis = startedMillis; + if (startedMs > state.lastEndedMs) { + nextState.lastEndedMs = startedMs; } // Select the request if it was preselected and there is no other selection. if (state.preselectedId && state.preselectedId === action.id) { nextState.selectedId = state.selectedId || state.preselectedId; nextState.preselectedId = null; } return nextState; } function updateRequest(state, action) { - const { requests, lastEndedMillis } = state; + const { requests, lastEndedMs } = state; let request = requests.get(action.id); if (!request) { return state; } request = { ...request, ...processNetworkUpdates(action.data, request), }; const requestEndTime = - request.startedMillis + + request.startedMs + (request.eventTimings ? request.eventTimings.totalTime : 0); return { ...state, requests: mapSet(state.requests, action.id, request), - lastEndedMillis: - requestEndTime > lastEndedMillis ? requestEndTime : lastEndedMillis, + lastEndedMs: requestEndTime > lastEndedMs ? requestEndTime : lastEndedMs, }; } function cloneRequest(state, id) { const { requests } = state; if (!id) { return state;
--- a/devtools/client/netmonitor/src/reducers/timing-markers.js +++ b/devtools/client/netmonitor/src/reducers/timing-markers.js @@ -16,19 +16,19 @@ function TimingMarkers() { firstDocumentDOMContentLoadedTimestamp: -1, firstDocumentLoadTimestamp: -1, firstDocumentRequestStartTimestamp: +Infinity, }; } function addRequest(state, action) { const nextState = { ...state }; - const { startedMillis } = action.data; - if (startedMillis < state.firstDocumentRequestStartTimestamp) { - nextState.firstDocumentRequestStartTimestamp = startedMillis; + const { startedMs } = action.data; + if (startedMs < state.firstDocumentRequestStartTimestamp) { + nextState.firstDocumentRequestStartTimestamp = startedMs; } return nextState; } function addTimingMarker(state, action) { state = { ...state };
--- a/devtools/client/netmonitor/src/selectors/requests.js +++ b/devtools/client/netmonitor/src/selectors/requests.js @@ -109,20 +109,20 @@ const getDisplayedRequests = createSelec const getTypeFilteredRequests = createSelector( state => state.requests, getTypeFilterFn, ({ requests }, filterFn) => [...requests.values()].filter(filterFn) ); const getDisplayedRequestsSummary = createSelector( getDisplayedRequests, - state => state.requests.lastEndedMillis - state.requests.firstStartedMillis, - (requests, totalMillis) => { + state => state.requests.lastEndedMs - state.requests.firstStartedMs, + (requests, totalMs) => { if (requests.size == 0) { - return { count: 0, bytes: 0, millis: 0 }; + return { count: 0, bytes: 0, ms: 0 }; } const totalBytes = requests.reduce( (totals, item) => { if (typeof item.contentSize == "number") { totals.contentSize += item.contentSize; } @@ -136,17 +136,17 @@ const getDisplayedRequestsSummary = crea return totals; }, { contentSize: 0, transferredSize: 0 } ); return { count: requests.size, contentSize: totalBytes.contentSize, - millis: totalMillis, + ms: totalMs, transferredSize: totalBytes.transferredSize, }; } ); const getSelectedRequest = createSelector( state => state.requests, ({ selectedId, requests }) =>
--- a/devtools/client/netmonitor/src/selectors/ui.js +++ b/devtools/client/netmonitor/src/selectors/ui.js @@ -9,29 +9,26 @@ const { REQUESTS_WATERFALL } = require(" const EPSILON = 0.001; const getWaterfallScale = createSelector( state => state.requests, state => state.timingMarkers, state => state.ui, (requests, timingMarkers, ui) => { - if ( - requests.firstStartedMillis === +Infinity || - ui.waterfallWidth === null - ) { + if (requests.firstStartedMs === +Infinity || ui.waterfallWidth === null) { return null; } - const lastEventMillis = Math.max( - requests.lastEndedMillis, + const lastEventMs = Math.max( + requests.lastEndedMs, timingMarkers.firstDocumentDOMContentLoadedTimestamp, timingMarkers.firstDocumentLoadTimestamp ); - const longestWidth = lastEventMillis - requests.firstStartedMillis; + const longestWidth = lastEventMs - requests.firstStartedMs; // Reduce 20px for the last request's requests-list-timings-total return Math.min( Math.max( (ui.waterfallWidth - REQUESTS_WATERFALL.LABEL_WIDTH - 20) / longestWidth, EPSILON ),
--- a/devtools/client/netmonitor/src/selectors/web-sockets.js +++ b/devtools/client/netmonitor/src/selectors/web-sockets.js @@ -55,33 +55,33 @@ const getSelectedFrame = createSelector( /** * Returns summary data of the list of frames that are visible to the user. * Filtered frames by types and text are factored in. */ const getDisplayedFramesSummary = createSelector( getDisplayedFrames, displayedFrames => { - let firstStartedMillis = +Infinity; - let lastEndedMillis = -Infinity; + let firstStartedMs = +Infinity; + let lastEndedMs = -Infinity; let totalSize = 0; displayedFrames.forEach(frame => { totalSize += frame.payload.length; - if (frame.timeStamp < firstStartedMillis) { - firstStartedMillis = frame.timeStamp; + if (frame.timeStamp < firstStartedMs) { + firstStartedMs = frame.timeStamp; } - if (frame.timeStamp > lastEndedMillis) { - lastEndedMillis = frame.timeStamp; + if (frame.timeStamp > lastEndedMs) { + lastEndedMs = frame.timeStamp; } }); return { count: displayedFrames.length, - totalMillis: (lastEndedMillis - firstStartedMillis) / 1000, + totalMs: (lastEndedMs - firstStartedMs) / 1000, totalSize, }; } ); module.exports = { getSelectedFrame, isSelectedFrameVisible,
--- a/devtools/client/netmonitor/src/utils/request-utils.js +++ b/devtools/client/netmonitor/src/utils/request-utils.js @@ -406,52 +406,49 @@ function ipToLong(ip) { function propertiesEqual(props, item1, item2) { return item1 === item2 || props.every(p => item1[p] === item2[p]); } /** * Calculate the start time of a request, which is the time from start * of 1st request until the start of this request. * - * Without a firstRequestStartedMillis argument the wrong time will be returned. + * Without a firstRequestStartedMs argument the wrong time will be returned. * However, it can be omitted when comparing two start times and neither supplies - * a firstRequestStartedMillis. + * a firstRequestStartedMs. */ -function getStartTime(item, firstRequestStartedMillis = 0) { - return item.startedMillis - firstRequestStartedMillis; +function getStartTime(item, firstRequestStartedMs = 0) { + return item.startedMs - firstRequestStartedMs; } /** * Calculate the end time of a request, which is the time from start * of 1st request until the end of this response. * - * Without a firstRequestStartedMillis argument the wrong time will be returned. + * Without a firstRequestStartedMs argument the wrong time will be returned. * However, it can be omitted when comparing two end times and neither supplies - * a firstRequestStartedMillis. + * a firstRequestStartedMs. */ -function getEndTime(item, firstRequestStartedMillis = 0) { - const { startedMillis, totalTime } = item; - return startedMillis + totalTime - firstRequestStartedMillis; +function getEndTime(item, firstRequestStartedMs = 0) { + const { startedMs, totalTime } = item; + return startedMs + totalTime - firstRequestStartedMs; } /** * Calculate the response time of a request, which is the time from start * of 1st request until the beginning of download of this response. * - * Without a firstRequestStartedMillis argument the wrong time will be returned. + * Without a firstRequestStartedMs argument the wrong time will be returned. * However, it can be omitted when comparing two response times and neither supplies - * a firstRequestStartedMillis. + * a firstRequestStartedMs. */ -function getResponseTime(item, firstRequestStartedMillis = 0) { - const { startedMillis, totalTime, eventTimings = { timings: {} } } = item; +function getResponseTime(item, firstRequestStartedMs = 0) { + const { startedMs, totalTime, eventTimings = { timings: {} } } = item; return ( - startedMillis + - totalTime - - firstRequestStartedMillis - - eventTimings.timings.receive + startedMs + totalTime - firstRequestStartedMs - eventTimings.timings.receive ); } /** * Format the protocols used by the request. */ function getFormattedProtocol(item) { const { httpVersion = "", responseHeaders = { headers: [] } } = item;
--- a/devtools/client/netmonitor/src/utils/sort-predicates.js +++ b/devtools/client/netmonitor/src/utils/sort-predicates.js @@ -30,17 +30,17 @@ const { RESPONSE_HEADERS } = require(".. function compareValues(first, second) { if (first === second) { return 0; } return first > second ? 1 : -1; } function waterfall(first, second) { - const result = compareValues(first.startedMillis, second.startedMillis); + const result = compareValues(first.startedMs, second.startedMs); return result || compareValues(first.id, second.id); } function status(first, second) { const result = compareValues(first.status, second.status); return result || waterfall(first, second); }
--- a/devtools/client/netmonitor/src/widgets/WaterfallBackground.js +++ b/devtools/client/netmonitor/src/widgets/WaterfallBackground.js @@ -5,17 +5,17 @@ "use strict"; const { getColor } = require("devtools/client/shared/theme"); const { colorUtils } = require("devtools/shared/css/color"); const { REQUESTS_WATERFALL } = require("../constants"); const HTML_NS = "http://www.w3.org/1999/xhtml"; const STATE_KEYS = [ - "firstRequestStartedMillis", + "firstRequestStartedMs", "scale", "timingMarkers", "waterfallWidth", ]; /** * Creates the background displayed on each waterfall view in this container. */ @@ -105,17 +105,17 @@ class WaterfallBackground { } function drawTimestamp(timestamp, color) { if (timestamp === -1) { return; } const delta = Math.floor( - (timestamp - state.firstRequestStartedMillis) * state.scale + (timestamp - state.firstRequestStartedMs) * state.scale ); drawPixelAt(delta, color); } const { DOMCONTENTLOADED_TICKS_COLOR, LOAD_TICKS_COLOR, } = REQUESTS_WATERFALL;
--- a/devtools/client/netmonitor/test/browser_net_footer-summary.js +++ b/devtools/client/netmonitor/test/browser_net_footer-summary.js @@ -90,21 +90,21 @@ add_task(async function() { ); const valueFinish = document.querySelector( ".requests-list-network-summary-finish" ).textContent; info("Current summary finish: " + valueFinish); const expectedFinish = L10N.getFormatStrWithNumbers( "networkMenu.summary.finish", - getFormattedTime(requestsSummary.millis) + getFormattedTime(requestsSummary.ms) ); info(`Computed total bytes: ${requestsSummary.bytes}`); - info(`Computed total millis: ${requestsSummary.millis}`); + info(`Computed total ms: ${requestsSummary.ms}`); is(valueCount, expectedCount, "The current summary count is correct."); is( valueTransfer, expectedTransfer, "The current summary transfer is correct." ); is(valueFinish, expectedFinish, "The current summary finish is correct.");
--- a/devtools/client/netmonitor/test/browser_net_simple-request-data.js +++ b/devtools/client/netmonitor/test/browser_net_simple-request-data.js @@ -68,24 +68,24 @@ function test() { is( typeof requestItem.id, "string", "The attached request id is incorrect." ); isnot(requestItem.id, "", "The attached request id should not be empty."); is( - typeof requestItem.startedMillis, + typeof requestItem.startedMs, "number", - "The attached startedMillis is incorrect." + "The attached startedMs is incorrect." ); isnot( - requestItem.startedMillis, + requestItem.startedMs, 0, - "The attached startedMillis should not be zero." + "The attached startedMs should not be zero." ); is( requestItem.requestHeaders, undefined, "The requestHeaders should not yet be set." ); is(