refactor(mobs/backend):write ResourceTiming to devtools.mob
This commit is contained in:
parent
6054aef8e5
commit
e6ad085f2e
7 changed files with 56 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
package messages
|
package messages
|
||||||
|
|
||||||
func IsReplayerType(id int) bool {
|
func IsReplayerType(id int) bool {
|
||||||
return 80 != id && 81 != id && 82 != id && 1 != id && 3 != id && 17 != id && 23 != id && 24 != id && 25 != id && 26 != id && 27 != id && 28 != id && 29 != id && 30 != id && 31 != id && 32 != id && 33 != id && 35 != id && 42 != id && 52 != id && 53 != id && 56 != id && 62 != id && 63 != id && 64 != id && 66 != id && 78 != id && 126 != id && 127 != id && 107 != id && 91 != id && 92 != id && 94 != id && 95 != id && 97 != id && 98 != id && 99 != id && 101 != id && 104 != id && 110 != id && 111 != id
|
return 80 != id && 81 != id && 82 != id && 1 != id && 3 != id && 17 != id && 23 != id && 24 != id && 25 != id && 26 != id && 27 != id && 28 != id && 29 != id && 30 != id && 31 != id && 32 != id && 33 != id && 35 != id && 42 != id && 52 != id && 56 != id && 62 != id && 63 != id && 64 != id && 66 != id && 78 != id && 126 != id && 127 != id && 107 != id && 91 != id && 92 != id && 94 != id && 95 != id && 97 != id && 98 != id && 99 != id && 101 != id && 104 != id && 110 != id && 111 != id
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsIOSType(id int) bool {
|
func IsIOSType(id int) bool {
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,28 @@ export default class RawMessageReader extends PrimitiveReader {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 53: {
|
||||||
|
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||||
|
const duration = this.readUint(); if (duration === null) { return resetPointer() }
|
||||||
|
const ttfb = this.readUint(); if (ttfb === null) { return resetPointer() }
|
||||||
|
const headerSize = this.readUint(); if (headerSize === null) { return resetPointer() }
|
||||||
|
const encodedBodySize = this.readUint(); if (encodedBodySize === null) { return resetPointer() }
|
||||||
|
const decodedBodySize = this.readUint(); if (decodedBodySize === null) { return resetPointer() }
|
||||||
|
const url = this.readString(); if (url === null) { return resetPointer() }
|
||||||
|
const initiator = this.readString(); if (initiator === null) { return resetPointer() }
|
||||||
|
return {
|
||||||
|
tp: MType.ResourceTiming,
|
||||||
|
timestamp,
|
||||||
|
duration,
|
||||||
|
ttfb,
|
||||||
|
headerSize,
|
||||||
|
encodedBodySize,
|
||||||
|
decodedBodySize,
|
||||||
|
url,
|
||||||
|
initiator,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case 54: {
|
case 54: {
|
||||||
const downlink = this.readUint(); if (downlink === null) { return resetPointer() }
|
const downlink = this.readUint(); if (downlink === null) { return resetPointer() }
|
||||||
const type = this.readString(); if (type === null) { return resetPointer() }
|
const type = this.readString(); if (type === null) { return resetPointer() }
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import type {
|
||||||
RawNgRx,
|
RawNgRx,
|
||||||
RawGraphQl,
|
RawGraphQl,
|
||||||
RawPerformanceTrack,
|
RawPerformanceTrack,
|
||||||
|
RawResourceTiming,
|
||||||
RawConnectionInformation,
|
RawConnectionInformation,
|
||||||
RawSetPageVisibility,
|
RawSetPageVisibility,
|
||||||
RawLoadFontFace,
|
RawLoadFontFace,
|
||||||
|
|
@ -124,6 +125,8 @@ export type GraphQl = RawGraphQl & Timed
|
||||||
|
|
||||||
export type PerformanceTrack = RawPerformanceTrack & Timed
|
export type PerformanceTrack = RawPerformanceTrack & Timed
|
||||||
|
|
||||||
|
export type ResourceTiming = RawResourceTiming & Timed
|
||||||
|
|
||||||
export type ConnectionInformation = RawConnectionInformation & Timed
|
export type ConnectionInformation = RawConnectionInformation & Timed
|
||||||
|
|
||||||
export type SetPageVisibility = RawSetPageVisibility & Timed
|
export type SetPageVisibility = RawSetPageVisibility & Timed
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ export const enum MType {
|
||||||
NgRx = 47,
|
NgRx = 47,
|
||||||
GraphQl = 48,
|
GraphQl = 48,
|
||||||
PerformanceTrack = 49,
|
PerformanceTrack = 49,
|
||||||
|
ResourceTiming = 53,
|
||||||
ConnectionInformation = 54,
|
ConnectionInformation = 54,
|
||||||
SetPageVisibility = 55,
|
SetPageVisibility = 55,
|
||||||
LoadFontFace = 57,
|
LoadFontFace = 57,
|
||||||
|
|
@ -266,6 +267,18 @@ export interface RawPerformanceTrack {
|
||||||
usedJSHeapSize: number,
|
usedJSHeapSize: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RawResourceTiming {
|
||||||
|
tp: MType.ResourceTiming,
|
||||||
|
timestamp: number,
|
||||||
|
duration: number,
|
||||||
|
ttfb: number,
|
||||||
|
headerSize: number,
|
||||||
|
encodedBodySize: number,
|
||||||
|
decodedBodySize: number,
|
||||||
|
url: string,
|
||||||
|
initiator: string,
|
||||||
|
}
|
||||||
|
|
||||||
export interface RawConnectionInformation {
|
export interface RawConnectionInformation {
|
||||||
tp: MType.ConnectionInformation,
|
tp: MType.ConnectionInformation,
|
||||||
downlink: number,
|
downlink: number,
|
||||||
|
|
@ -461,4 +474,4 @@ export interface RawIosNetworkCall {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export type RawMessage = RawTimestamp | RawSetPageLocation | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawIosSessionStart | RawIosCustomEvent | RawIosScreenChanges | RawIosClickEvent | RawIosPerformanceEvent | RawIosLog | RawIosNetworkCall;
|
export type RawMessage = RawTimestamp | RawSetPageLocation | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawResourceTiming | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawIosSessionStart | RawIosCustomEvent | RawIosScreenChanges | RawIosClickEvent | RawIosPerformanceEvent | RawIosLog | RawIosNetworkCall;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ export const TP_MAP = {
|
||||||
47: MType.NgRx,
|
47: MType.NgRx,
|
||||||
48: MType.GraphQl,
|
48: MType.GraphQl,
|
||||||
49: MType.PerformanceTrack,
|
49: MType.PerformanceTrack,
|
||||||
|
53: MType.ResourceTiming,
|
||||||
54: MType.ConnectionInformation,
|
54: MType.ConnectionInformation,
|
||||||
55: MType.SetPageVisibility,
|
55: MType.SetPageVisibility,
|
||||||
57: MType.LoadFontFace,
|
57: MType.LoadFontFace,
|
||||||
|
|
|
||||||
|
|
@ -687,6 +687,20 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 53: {
|
||||||
|
return {
|
||||||
|
tp: MType.ResourceTiming,
|
||||||
|
timestamp: tMsg[1],
|
||||||
|
duration: tMsg[2],
|
||||||
|
ttfb: tMsg[3],
|
||||||
|
headerSize: tMsg[4],
|
||||||
|
encodedBodySize: tMsg[5],
|
||||||
|
decodedBodySize: tMsg[6],
|
||||||
|
url: tMsg[7],
|
||||||
|
initiator: tMsg[8],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case 54: {
|
case 54: {
|
||||||
return {
|
return {
|
||||||
tp: MType.ConnectionInformation,
|
tp: MType.ConnectionInformation,
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ end
|
||||||
message 52, 'DOMDrop', :tracker => false, :replayer => false do
|
message 52, 'DOMDrop', :tracker => false, :replayer => false do
|
||||||
uint 'Timestamp'
|
uint 'Timestamp'
|
||||||
end
|
end
|
||||||
message 53, 'ResourceTiming', :replayer => false do
|
message 53, 'ResourceTiming', :replayer => :devtools do
|
||||||
uint 'Timestamp'
|
uint 'Timestamp'
|
||||||
uint 'Duration'
|
uint 'Duration'
|
||||||
uint 'TTFB'
|
uint 'TTFB'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue