rename to walltime
This commit is contained in:
parent
932095ccad
commit
59e750bc88
|
|
@ -137,7 +137,7 @@ export class Snapshotter {
|
|||
html: data.html,
|
||||
viewport: data.viewport,
|
||||
timestamp: monotonicTime(),
|
||||
absoluteTimestamp: data.absoluteTimestamp,
|
||||
wallTime: data.wallTime,
|
||||
collectionTime: data.collectionTime,
|
||||
resourceOverrides: [],
|
||||
isMainFrame: page.mainFrame() === frame
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export type SnapshotData = {
|
|||
}[],
|
||||
viewport: { width: number, height: number },
|
||||
url: string,
|
||||
absoluteTimestamp: number, // milliseconds since epoch
|
||||
wallTime: number,
|
||||
collectionTime: number,
|
||||
};
|
||||
|
||||
|
|
@ -572,7 +572,7 @@ export function frameSnapshotStreamer(snapshotStreamer: string, removeNoScript:
|
|||
height: window.innerHeight,
|
||||
},
|
||||
url: location.href,
|
||||
absoluteTimestamp: Date.now(),
|
||||
wallTime: Date.now(),
|
||||
collectionTime: 0,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export class SnapshotServer {
|
|||
viewport: snapshot.viewport(),
|
||||
url: snapshot.snapshot().frameUrl,
|
||||
timestamp: snapshot.snapshot().timestamp,
|
||||
absoluteTimestamp: snapshot.snapshot().absoluteTimestamp,
|
||||
wallTime: snapshot.snapshot().wallTime,
|
||||
} : {
|
||||
error: 'No snapshot found'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -395,6 +395,10 @@ export class TraceModernizer {
|
|||
result.push({ ...event, monotonicTime: 0, origin: 'library' });
|
||||
continue;
|
||||
}
|
||||
if (event.type === 'frame-snapshot') {
|
||||
result.push({ ...event, snapshot: { ...event.snapshot, wallTime: 0 } });
|
||||
continue;
|
||||
}
|
||||
// Take wall and monotonic time from the first event.
|
||||
if (!this._contextEntry.wallTime && event.type === 'before')
|
||||
this._contextEntry.wallTime = event.wallTime;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ export const SnapshotTab: React.FunctionComponent<{
|
|||
|
||||
const iframeRef0 = React.useRef<HTMLIFrameElement>(null);
|
||||
const iframeRef1 = React.useRef<HTMLIFrameElement>(null);
|
||||
const [snapshotInfo, setSnapshotInfo] = React.useState<{ viewport: typeof kDefaultViewport, url: string, timestamp?: number, absoluteTimestamp?: undefined }>({ viewport: kDefaultViewport, url: '' });
|
||||
const [snapshotInfo, setSnapshotInfo] = React.useState<{ viewport: typeof kDefaultViewport, url: string, timestamp?: number, wallTime?: undefined }>({ viewport: kDefaultViewport, url: '' });
|
||||
const loadingRef = React.useRef({ iteration: 0, visibleIframe: 0 });
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
@ -110,7 +110,7 @@ export const SnapshotTab: React.FunctionComponent<{
|
|||
const newVisibleIframe = 1 - loadingRef.current.visibleIframe;
|
||||
loadingRef.current.iteration = thisIteration;
|
||||
|
||||
const newSnapshotInfo = { url: '', viewport: kDefaultViewport, timestamp: undefined, absoluteTimestamp: undefined };
|
||||
const newSnapshotInfo = { url: '', viewport: kDefaultViewport, timestamp: undefined, wallTime: undefined };
|
||||
if (snapshotInfoUrl) {
|
||||
const response = await fetch(snapshotInfoUrl);
|
||||
const info = await response.json();
|
||||
|
|
@ -118,7 +118,7 @@ export const SnapshotTab: React.FunctionComponent<{
|
|||
newSnapshotInfo.url = info.url;
|
||||
newSnapshotInfo.viewport = info.viewport;
|
||||
newSnapshotInfo.timestamp = info.timestamp;
|
||||
newSnapshotInfo.absoluteTimestamp = info.absoluteTimestamp;
|
||||
newSnapshotInfo.wallTime = info.wallTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -170,13 +170,13 @@ export const SnapshotTab: React.FunctionComponent<{
|
|||
const page = action ? pageForAction(action) : undefined;
|
||||
const screencastFrame = React.useMemo(
|
||||
() => {
|
||||
if (snapshotInfo.absoluteTimestamp && page?.screencastFrames[0]?.frameSwapTimestamp)
|
||||
return findClosest(page.screencastFrames, frame => frame.frameSwapTimestamp!, snapshotInfo.absoluteTimestamp);
|
||||
if (snapshotInfo.wallTime && page?.screencastFrames[0]?.frameSwapTimestamp)
|
||||
return findClosest(page.screencastFrames, frame => frame.frameSwapTimestamp!, snapshotInfo.wallTime);
|
||||
|
||||
if (snapshotInfo.timestamp && page?.screencastFrames)
|
||||
return findClosest(page.screencastFrames, frame => frame.timestamp, snapshotInfo.timestamp);
|
||||
},
|
||||
[page?.screencastFrames, snapshotInfo.timestamp, snapshotInfo.absoluteTimestamp]
|
||||
[page?.screencastFrames, snapshotInfo.timestamp, snapshotInfo.wallTime]
|
||||
);
|
||||
|
||||
return <div
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export type FrameSnapshot = {
|
|||
frameId: string,
|
||||
frameUrl: string,
|
||||
timestamp: number,
|
||||
absoluteTimestamp: number,
|
||||
wallTime: number,
|
||||
collectionTime: number,
|
||||
doctype?: string,
|
||||
html: NodeSnapshot,
|
||||
|
|
|
|||
Loading…
Reference in a new issue