summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/selectors/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/netmonitor/selectors/index.js')
-rw-r--r--devtools/client/netmonitor/selectors/index.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/devtools/client/netmonitor/selectors/index.js b/devtools/client/netmonitor/selectors/index.js
index 60d6007cd..612188758 100644
--- a/devtools/client/netmonitor/selectors/index.js
+++ b/devtools/client/netmonitor/selectors/index.js
@@ -73,6 +73,24 @@ const getDisplayedRequestsSummary = createSelector(
})
);
+function getDisplayedTimingMarker(state, marker) {
+ let timingMarker = null;
+ if (state.timingMarkers) {
+ timingMarker = state.timingMarkers.get(marker);
+ }
+ let firstRequestStartedMillis = null;
+ if (state.requests.items.length) {
+ firstRequestStartedMillis = state.requests.items[0]
+ .attachment.firstRequestStartedMillis;
+ }
+ if (timingMarker && firstRequestStartedMillis) {
+ return timingMarker - firstRequestStartedMillis;
+ } else {
+ return -1;
+ }
+}
+
module.exports = {
getDisplayedRequestsSummary,
+ getDisplayedTimingMarker,
};