change(tracker): fix msgs format
This commit is contained in:
parent
702e2f3def
commit
7156fa0fc4
14 changed files with 30 additions and 263 deletions
|
|
@ -22,7 +22,7 @@ const (
|
|||
MsgSetInputValue = 18
|
||||
MsgSetInputChecked = 19
|
||||
MsgMouseMove = 20
|
||||
MsgLegacyNetworkRequest = 21
|
||||
MsgNetworkRequest = 21
|
||||
MsgConsoleLog = 22
|
||||
MsgPageLoadTiming = 23
|
||||
MsgPageRenderTiming = 24
|
||||
|
|
@ -81,7 +81,6 @@ const (
|
|||
MsgMouseThrashing = 114
|
||||
MsgUnbindNodes = 115
|
||||
MsgResourceTiming = 116
|
||||
MsgNetworkRequest = 117
|
||||
MsgIssueEvent = 125
|
||||
MsgSessionEnd = 126
|
||||
MsgSessionSearch = 127
|
||||
|
|
@ -603,7 +602,7 @@ func (msg *MouseMove) TypeID() int {
|
|||
return 20
|
||||
}
|
||||
|
||||
type LegacyNetworkRequest struct {
|
||||
type NetworkRequest struct {
|
||||
message
|
||||
Type string
|
||||
Method string
|
||||
|
|
@ -615,7 +614,7 @@ type LegacyNetworkRequest struct {
|
|||
Duration uint64
|
||||
}
|
||||
|
||||
func (msg *LegacyNetworkRequest) Encode() []byte {
|
||||
func (msg *NetworkRequest) Encode() []byte {
|
||||
buf := make([]byte, 81+len(msg.Type)+len(msg.Method)+len(msg.URL)+len(msg.Request)+len(msg.Response))
|
||||
buf[0] = 21
|
||||
p := 1
|
||||
|
|
@ -630,11 +629,11 @@ func (msg *LegacyNetworkRequest) Encode() []byte {
|
|||
return buf[:p]
|
||||
}
|
||||
|
||||
func (msg *LegacyNetworkRequest) Decode() Message {
|
||||
func (msg *NetworkRequest) Decode() Message {
|
||||
return msg
|
||||
}
|
||||
|
||||
func (msg *LegacyNetworkRequest) TypeID() int {
|
||||
func (msg *NetworkRequest) TypeID() int {
|
||||
return 21
|
||||
}
|
||||
|
||||
|
|
@ -2164,43 +2163,6 @@ func (msg *ResourceTiming) TypeID() int {
|
|||
return 116
|
||||
}
|
||||
|
||||
type NetworkRequest struct {
|
||||
message
|
||||
Type string
|
||||
Method string
|
||||
URL string
|
||||
Request string
|
||||
Response string
|
||||
Status uint64
|
||||
Timestamp uint64
|
||||
Duration uint64
|
||||
Cached bool
|
||||
}
|
||||
|
||||
func (msg *NetworkRequest) Encode() []byte {
|
||||
buf := make([]byte, 91+len(msg.Type)+len(msg.Method)+len(msg.URL)+len(msg.Request)+len(msg.Response))
|
||||
buf[0] = 117
|
||||
p := 1
|
||||
p = WriteString(msg.Type, buf, p)
|
||||
p = WriteString(msg.Method, buf, p)
|
||||
p = WriteString(msg.URL, buf, p)
|
||||
p = WriteString(msg.Request, buf, p)
|
||||
p = WriteString(msg.Response, buf, p)
|
||||
p = WriteUint(msg.Status, buf, p)
|
||||
p = WriteUint(msg.Timestamp, buf, p)
|
||||
p = WriteUint(msg.Duration, buf, p)
|
||||
p = WriteBoolean(msg.Cached, buf, p)
|
||||
return buf[:p]
|
||||
}
|
||||
|
||||
func (msg *NetworkRequest) Decode() Message {
|
||||
return msg
|
||||
}
|
||||
|
||||
func (msg *NetworkRequest) TypeID() int {
|
||||
return 117
|
||||
}
|
||||
|
||||
type IssueEvent struct {
|
||||
message
|
||||
MessageID uint64
|
||||
|
|
|
|||
|
|
@ -300,9 +300,9 @@ func DecodeMouseMove(reader BytesReader) (Message, error) {
|
|||
return msg, err
|
||||
}
|
||||
|
||||
func DecodeLegacyNetworkRequest(reader BytesReader) (Message, error) {
|
||||
func DecodeNetworkRequest(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &LegacyNetworkRequest{}
|
||||
msg := &NetworkRequest{}
|
||||
if msg.Type, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1314,39 +1314,6 @@ func DecodeResourceTiming(reader BytesReader) (Message, error) {
|
|||
return msg, err
|
||||
}
|
||||
|
||||
func DecodeNetworkRequest(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &NetworkRequest{}
|
||||
if msg.Type, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Method, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.URL, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Request, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Response, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Status, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Timestamp, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Duration, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Cached, err = reader.ReadBoolean(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return msg, err
|
||||
}
|
||||
|
||||
func DecodeIssueEvent(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &IssueEvent{}
|
||||
|
|
@ -1843,7 +1810,7 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
case 20:
|
||||
return DecodeMouseMove(reader)
|
||||
case 21:
|
||||
return DecodeLegacyNetworkRequest(reader)
|
||||
return DecodeNetworkRequest(reader)
|
||||
case 22:
|
||||
return DecodeConsoleLog(reader)
|
||||
case 23:
|
||||
|
|
@ -1960,8 +1927,6 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
return DecodeUnbindNodes(reader)
|
||||
case 116:
|
||||
return DecodeResourceTiming(reader)
|
||||
case 117:
|
||||
return DecodeNetworkRequest(reader)
|
||||
case 125:
|
||||
return DecodeIssueEvent(reader)
|
||||
case 126:
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class MouseMove(Message):
|
|||
self.y = y
|
||||
|
||||
|
||||
class LegacyNetworkRequest(Message):
|
||||
class NetworkRequest(Message):
|
||||
__id__ = 21
|
||||
|
||||
def __init__(self, type, method, url, request, response, status, timestamp, duration):
|
||||
|
|
@ -759,21 +759,6 @@ class ResourceTiming(Message):
|
|||
self.cached = cached
|
||||
|
||||
|
||||
class NetworkRequest(Message):
|
||||
__id__ = 117
|
||||
|
||||
def __init__(self, type, method, url, request, response, status, timestamp, duration, cached):
|
||||
self.type = type
|
||||
self.method = method
|
||||
self.url = url
|
||||
self.request = request
|
||||
self.response = response
|
||||
self.status = status
|
||||
self.timestamp = timestamp
|
||||
self.duration = duration
|
||||
self.cached = cached
|
||||
|
||||
|
||||
class IssueEvent(Message):
|
||||
__id__ = 125
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class MessageCodec(Codec):
|
|||
)
|
||||
|
||||
if message_id == 21:
|
||||
return LegacyNetworkRequest(
|
||||
return NetworkRequest(
|
||||
type=self.read_string(reader),
|
||||
method=self.read_string(reader),
|
||||
url=self.read_string(reader),
|
||||
|
|
@ -671,19 +671,6 @@ class MessageCodec(Codec):
|
|||
cached=self.read_boolean(reader)
|
||||
)
|
||||
|
||||
if message_id == 117:
|
||||
return NetworkRequest(
|
||||
type=self.read_string(reader),
|
||||
method=self.read_string(reader),
|
||||
url=self.read_string(reader),
|
||||
request=self.read_string(reader),
|
||||
response=self.read_string(reader),
|
||||
status=self.read_uint(reader),
|
||||
timestamp=self.read_uint(reader),
|
||||
duration=self.read_uint(reader),
|
||||
cached=self.read_boolean(reader)
|
||||
)
|
||||
|
||||
if message_id == 125:
|
||||
return IssueEvent(
|
||||
message_id=self.read_uint(reader),
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ export default class RawMessageReader extends PrimitiveReader {
|
|||
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||
const duration = this.readUint(); if (duration === null) { return resetPointer() }
|
||||
return {
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
tp: MType.NetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
|
|
@ -673,30 +673,6 @@ export default class RawMessageReader extends PrimitiveReader {
|
|||
};
|
||||
}
|
||||
|
||||
case 117: {
|
||||
const type = this.readString(); if (type === null) { return resetPointer() }
|
||||
const method = this.readString(); if (method === null) { return resetPointer() }
|
||||
const url = this.readString(); if (url === null) { return resetPointer() }
|
||||
const request = this.readString(); if (request === null) { return resetPointer() }
|
||||
const response = this.readString(); if (response === null) { return resetPointer() }
|
||||
const status = this.readUint(); if (status === null) { return resetPointer() }
|
||||
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||
const duration = this.readUint(); if (duration === null) { return resetPointer() }
|
||||
const cached = this.readBoolean(); if (cached === null) { return resetPointer() }
|
||||
return {
|
||||
tp: MType.NetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
request,
|
||||
response,
|
||||
status,
|
||||
timestamp,
|
||||
duration,
|
||||
cached,
|
||||
};
|
||||
}
|
||||
|
||||
case 90: {
|
||||
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||
const projectID = this.readUint(); if (projectID === null) { return resetPointer() }
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import type {
|
|||
RawSetInputValue,
|
||||
RawSetInputChecked,
|
||||
RawMouseMove,
|
||||
RawLegacyNetworkRequest,
|
||||
RawNetworkRequest,
|
||||
RawConsoleLog,
|
||||
RawCssInsertRule,
|
||||
RawCssDeleteRule,
|
||||
|
|
@ -58,7 +58,6 @@ import type {
|
|||
RawSelectionChange,
|
||||
RawMouseThrashing,
|
||||
RawResourceTiming,
|
||||
RawNetworkRequest,
|
||||
RawIosSessionStart,
|
||||
RawIosCustomEvent,
|
||||
RawIosScreenChanges,
|
||||
|
|
@ -105,7 +104,7 @@ export type SetInputChecked = RawSetInputChecked & Timed
|
|||
|
||||
export type MouseMove = RawMouseMove & Timed
|
||||
|
||||
export type LegacyNetworkRequest = RawLegacyNetworkRequest & Timed
|
||||
export type NetworkRequest = RawNetworkRequest & Timed
|
||||
|
||||
export type ConsoleLog = RawConsoleLog & Timed
|
||||
|
||||
|
|
@ -179,8 +178,6 @@ export type MouseThrashing = RawMouseThrashing & Timed
|
|||
|
||||
export type ResourceTiming = RawResourceTiming & Timed
|
||||
|
||||
export type NetworkRequest = RawNetworkRequest & Timed
|
||||
|
||||
export type IosSessionStart = RawIosSessionStart & Timed
|
||||
|
||||
export type IosCustomEvent = RawIosCustomEvent & Timed
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export const enum MType {
|
|||
SetInputValue = 18,
|
||||
SetInputChecked = 19,
|
||||
MouseMove = 20,
|
||||
LegacyNetworkRequest = 21,
|
||||
NetworkRequest = 21,
|
||||
ConsoleLog = 22,
|
||||
CssInsertRule = 37,
|
||||
CssDeleteRule = 38,
|
||||
|
|
@ -56,7 +56,6 @@ export const enum MType {
|
|||
SelectionChange = 113,
|
||||
MouseThrashing = 114,
|
||||
ResourceTiming = 116,
|
||||
NetworkRequest = 117,
|
||||
IosSessionStart = 90,
|
||||
IosCustomEvent = 93,
|
||||
IosScreenChanges = 96,
|
||||
|
|
@ -175,8 +174,8 @@ export interface RawMouseMove {
|
|||
y: number,
|
||||
}
|
||||
|
||||
export interface RawLegacyNetworkRequest {
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
export interface RawNetworkRequest {
|
||||
tp: MType.NetworkRequest,
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
|
|
@ -448,19 +447,6 @@ export interface RawResourceTiming {
|
|||
cached: boolean,
|
||||
}
|
||||
|
||||
export interface RawNetworkRequest {
|
||||
tp: MType.NetworkRequest,
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
request: string,
|
||||
response: string,
|
||||
status: number,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
cached: boolean,
|
||||
}
|
||||
|
||||
export interface RawIosSessionStart {
|
||||
tp: MType.IosSessionStart,
|
||||
timestamp: number,
|
||||
|
|
@ -532,4 +518,4 @@ export interface RawIosNetworkCall {
|
|||
}
|
||||
|
||||
|
||||
export type RawMessage = RawTimestamp | RawSetPageLocation | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawLegacyNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingDeprecated | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawNetworkRequest | 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 | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingDeprecated | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawIosSessionStart | RawIosCustomEvent | RawIosScreenChanges | RawIosClickEvent | RawIosPerformanceEvent | RawIosLog | RawIosNetworkCall;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export const TP_MAP = {
|
|||
18: MType.SetInputValue,
|
||||
19: MType.SetInputChecked,
|
||||
20: MType.MouseMove,
|
||||
21: MType.LegacyNetworkRequest,
|
||||
21: MType.NetworkRequest,
|
||||
22: MType.ConsoleLog,
|
||||
37: MType.CssInsertRule,
|
||||
38: MType.CssDeleteRule,
|
||||
|
|
@ -57,7 +57,6 @@ export const TP_MAP = {
|
|||
113: MType.SelectionChange,
|
||||
114: MType.MouseThrashing,
|
||||
116: MType.ResourceTiming,
|
||||
117: MType.NetworkRequest,
|
||||
90: MType.IosSessionStart,
|
||||
93: MType.IosCustomEvent,
|
||||
96: MType.IosScreenChanges,
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ type TrMouseMove = [
|
|||
y: number,
|
||||
]
|
||||
|
||||
type TrLegacyNetworkRequest = [
|
||||
type TrNetworkRequest = [
|
||||
type: 21,
|
||||
type: string,
|
||||
method: string,
|
||||
|
|
@ -470,21 +470,8 @@ type TrResourceTiming = [
|
|||
cached: boolean,
|
||||
]
|
||||
|
||||
type TrNetworkRequest = [
|
||||
type: 117,
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
request: string,
|
||||
response: string,
|
||||
status: number,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
cached: boolean,
|
||||
]
|
||||
|
||||
|
||||
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrLegacyNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingDeprecated | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming | TrNetworkRequest
|
||||
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingDeprecated | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming
|
||||
|
||||
export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
||||
switch(tMsg[0]) {
|
||||
|
|
@ -625,7 +612,7 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
|||
|
||||
case 21: {
|
||||
return {
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
tp: MType.NetworkRequest,
|
||||
type: tMsg[1],
|
||||
method: tMsg[2],
|
||||
url: tMsg[3],
|
||||
|
|
@ -953,21 +940,6 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
|||
}
|
||||
}
|
||||
|
||||
case 117: {
|
||||
return {
|
||||
tp: MType.NetworkRequest,
|
||||
type: tMsg[1],
|
||||
method: tMsg[2],
|
||||
url: tMsg[3],
|
||||
request: tMsg[4],
|
||||
response: tMsg[5],
|
||||
status: tMsg[6],
|
||||
timestamp: tMsg[7],
|
||||
duration: tMsg[8],
|
||||
cached: tMsg[9],
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ message 20, 'MouseMove' do
|
|||
uint 'X'
|
||||
uint 'Y'
|
||||
end
|
||||
message 21, 'LegacyNetworkRequest', :replayer => :devtools do
|
||||
message 21, 'NetworkRequest', :replayer => :devtools do
|
||||
string 'Type' # fetch/xhr/anythingElse(axios,gql,fonts,image?)
|
||||
string 'Method'
|
||||
string 'URL'
|
||||
|
|
@ -484,20 +484,6 @@ message 116, 'ResourceTiming', :replayer => :devtools do
|
|||
boolean 'Cached'
|
||||
end
|
||||
|
||||
message 117, 'NetworkRequest', :replayer => :devtools do
|
||||
string 'Type' # fetch/xhr/anythingElse(axios,gql,fonts,image?)
|
||||
string 'Method'
|
||||
string 'URL'
|
||||
string 'Request'
|
||||
string 'Response'
|
||||
uint 'Status'
|
||||
uint 'Timestamp'
|
||||
uint 'Duration'
|
||||
boolean 'Cached'
|
||||
end
|
||||
|
||||
|
||||
|
||||
## Backend-only
|
||||
message 125, 'IssueEvent', :replayer => false, :tracker => false do
|
||||
uint 'MessageID'
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export declare const enum Type {
|
|||
SetInputValue = 18,
|
||||
SetInputChecked = 19,
|
||||
MouseMove = 20,
|
||||
LegacyNetworkRequest = 21,
|
||||
NetworkRequest = 21,
|
||||
ConsoleLog = 22,
|
||||
PageLoadTiming = 23,
|
||||
PageRenderTiming = 24,
|
||||
|
|
@ -68,7 +68,6 @@ export declare const enum Type {
|
|||
MouseThrashing = 114,
|
||||
UnbindNodes = 115,
|
||||
ResourceTiming = 116,
|
||||
NetworkRequest = 117,
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -180,8 +179,8 @@ export type MouseMove = [
|
|||
/*y:*/ number,
|
||||
]
|
||||
|
||||
export type LegacyNetworkRequest = [
|
||||
/*type:*/ Type.LegacyNetworkRequest,
|
||||
export type NetworkRequest = [
|
||||
/*type:*/ Type.NetworkRequest,
|
||||
/*type:*/ string,
|
||||
/*method:*/ string,
|
||||
/*url:*/ string,
|
||||
|
|
@ -537,19 +536,6 @@ export type ResourceTiming = [
|
|||
/*cached:*/ boolean,
|
||||
]
|
||||
|
||||
export type NetworkRequest = [
|
||||
/*type:*/ Type.NetworkRequest,
|
||||
/*type:*/ string,
|
||||
/*method:*/ string,
|
||||
/*url:*/ string,
|
||||
/*request:*/ string,
|
||||
/*response:*/ string,
|
||||
/*status:*/ number,
|
||||
/*timestamp:*/ number,
|
||||
/*duration:*/ number,
|
||||
/*cached:*/ boolean,
|
||||
]
|
||||
|
||||
|
||||
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | LegacyNetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | StringDict | SetNodeAttributeDict | ResourceTimingDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | NetworkRequest
|
||||
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | StringDict | SetNodeAttributeDict | ResourceTimingDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming
|
||||
export default Message
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ export function MouseMove(
|
|||
]
|
||||
}
|
||||
|
||||
export function LegacyNetworkRequest(
|
||||
export function NetworkRequest(
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
|
|
@ -213,9 +213,9 @@ export function LegacyNetworkRequest(
|
|||
status: number,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
): Messages.LegacyNetworkRequest {
|
||||
): Messages.NetworkRequest {
|
||||
return [
|
||||
Messages.Type.LegacyNetworkRequest,
|
||||
Messages.Type.NetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
|
|
@ -869,28 +869,3 @@ export function ResourceTiming(
|
|||
]
|
||||
}
|
||||
|
||||
export function NetworkRequest(
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
request: string,
|
||||
response: string,
|
||||
status: number,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
cached: boolean,
|
||||
): Messages.NetworkRequest {
|
||||
return [
|
||||
Messages.Type.NetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
request,
|
||||
response,
|
||||
status,
|
||||
timestamp,
|
||||
duration,
|
||||
cached,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
return
|
||||
}
|
||||
|
||||
const isCached = r.status === 304 || checkCacheByPerformanceTimings(reqResInfo.url)
|
||||
app.send(
|
||||
NetworkRequest(
|
||||
'fetch',
|
||||
|
|
@ -230,7 +229,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
r.status,
|
||||
startTime + getTimeOrigin(),
|
||||
duration,
|
||||
isCached,
|
||||
),
|
||||
)
|
||||
})
|
||||
|
|
@ -287,8 +285,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
return
|
||||
}
|
||||
|
||||
const isCached =
|
||||
xhr.status === 304 || (xhr.status < 400 && checkCacheByPerformanceTimings(reqResInfo.url))
|
||||
app.send(
|
||||
NetworkRequest(
|
||||
'xhr',
|
||||
|
|
@ -299,7 +295,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
xhr.status,
|
||||
startTime + getTimeOrigin(),
|
||||
duration,
|
||||
isCached,
|
||||
),
|
||||
)
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
|||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
case Messages.Type.LegacyNetworkRequest:
|
||||
case Messages.Type.NetworkRequest:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.string(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8])
|
||||
break
|
||||
|
||||
|
|
@ -274,10 +274,6 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
|||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.string(msg[7]) && this.string(msg[8]) && this.uint(msg[9]) && this.boolean(msg[10])
|
||||
break
|
||||
|
||||
case Messages.Type.NetworkRequest:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.string(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8]) && this.boolean(msg[9])
|
||||
break
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue