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
|
MsgSetInputValue = 18
|
||||||
MsgSetInputChecked = 19
|
MsgSetInputChecked = 19
|
||||||
MsgMouseMove = 20
|
MsgMouseMove = 20
|
||||||
MsgLegacyNetworkRequest = 21
|
MsgNetworkRequest = 21
|
||||||
MsgConsoleLog = 22
|
MsgConsoleLog = 22
|
||||||
MsgPageLoadTiming = 23
|
MsgPageLoadTiming = 23
|
||||||
MsgPageRenderTiming = 24
|
MsgPageRenderTiming = 24
|
||||||
|
|
@ -81,7 +81,6 @@ const (
|
||||||
MsgMouseThrashing = 114
|
MsgMouseThrashing = 114
|
||||||
MsgUnbindNodes = 115
|
MsgUnbindNodes = 115
|
||||||
MsgResourceTiming = 116
|
MsgResourceTiming = 116
|
||||||
MsgNetworkRequest = 117
|
|
||||||
MsgIssueEvent = 125
|
MsgIssueEvent = 125
|
||||||
MsgSessionEnd = 126
|
MsgSessionEnd = 126
|
||||||
MsgSessionSearch = 127
|
MsgSessionSearch = 127
|
||||||
|
|
@ -603,7 +602,7 @@ func (msg *MouseMove) TypeID() int {
|
||||||
return 20
|
return 20
|
||||||
}
|
}
|
||||||
|
|
||||||
type LegacyNetworkRequest struct {
|
type NetworkRequest struct {
|
||||||
message
|
message
|
||||||
Type string
|
Type string
|
||||||
Method string
|
Method string
|
||||||
|
|
@ -615,7 +614,7 @@ type LegacyNetworkRequest struct {
|
||||||
Duration uint64
|
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 := make([]byte, 81+len(msg.Type)+len(msg.Method)+len(msg.URL)+len(msg.Request)+len(msg.Response))
|
||||||
buf[0] = 21
|
buf[0] = 21
|
||||||
p := 1
|
p := 1
|
||||||
|
|
@ -630,11 +629,11 @@ func (msg *LegacyNetworkRequest) Encode() []byte {
|
||||||
return buf[:p]
|
return buf[:p]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (msg *LegacyNetworkRequest) Decode() Message {
|
func (msg *NetworkRequest) Decode() Message {
|
||||||
return msg
|
return msg
|
||||||
}
|
}
|
||||||
|
|
||||||
func (msg *LegacyNetworkRequest) TypeID() int {
|
func (msg *NetworkRequest) TypeID() int {
|
||||||
return 21
|
return 21
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2164,43 +2163,6 @@ func (msg *ResourceTiming) TypeID() int {
|
||||||
return 116
|
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 {
|
type IssueEvent struct {
|
||||||
message
|
message
|
||||||
MessageID uint64
|
MessageID uint64
|
||||||
|
|
|
||||||
|
|
@ -300,9 +300,9 @@ func DecodeMouseMove(reader BytesReader) (Message, error) {
|
||||||
return msg, err
|
return msg, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func DecodeLegacyNetworkRequest(reader BytesReader) (Message, error) {
|
func DecodeNetworkRequest(reader BytesReader) (Message, error) {
|
||||||
var err error = nil
|
var err error = nil
|
||||||
msg := &LegacyNetworkRequest{}
|
msg := &NetworkRequest{}
|
||||||
if msg.Type, err = reader.ReadString(); err != nil {
|
if msg.Type, err = reader.ReadString(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -1314,39 +1314,6 @@ func DecodeResourceTiming(reader BytesReader) (Message, error) {
|
||||||
return msg, err
|
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) {
|
func DecodeIssueEvent(reader BytesReader) (Message, error) {
|
||||||
var err error = nil
|
var err error = nil
|
||||||
msg := &IssueEvent{}
|
msg := &IssueEvent{}
|
||||||
|
|
@ -1843,7 +1810,7 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
||||||
case 20:
|
case 20:
|
||||||
return DecodeMouseMove(reader)
|
return DecodeMouseMove(reader)
|
||||||
case 21:
|
case 21:
|
||||||
return DecodeLegacyNetworkRequest(reader)
|
return DecodeNetworkRequest(reader)
|
||||||
case 22:
|
case 22:
|
||||||
return DecodeConsoleLog(reader)
|
return DecodeConsoleLog(reader)
|
||||||
case 23:
|
case 23:
|
||||||
|
|
@ -1960,8 +1927,6 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
||||||
return DecodeUnbindNodes(reader)
|
return DecodeUnbindNodes(reader)
|
||||||
case 116:
|
case 116:
|
||||||
return DecodeResourceTiming(reader)
|
return DecodeResourceTiming(reader)
|
||||||
case 117:
|
|
||||||
return DecodeNetworkRequest(reader)
|
|
||||||
case 125:
|
case 125:
|
||||||
return DecodeIssueEvent(reader)
|
return DecodeIssueEvent(reader)
|
||||||
case 126:
|
case 126:
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ class MouseMove(Message):
|
||||||
self.y = y
|
self.y = y
|
||||||
|
|
||||||
|
|
||||||
class LegacyNetworkRequest(Message):
|
class NetworkRequest(Message):
|
||||||
__id__ = 21
|
__id__ = 21
|
||||||
|
|
||||||
def __init__(self, type, method, url, request, response, status, timestamp, duration):
|
def __init__(self, type, method, url, request, response, status, timestamp, duration):
|
||||||
|
|
@ -759,21 +759,6 @@ class ResourceTiming(Message):
|
||||||
self.cached = cached
|
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):
|
class IssueEvent(Message):
|
||||||
__id__ = 125
|
__id__ = 125
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ class MessageCodec(Codec):
|
||||||
)
|
)
|
||||||
|
|
||||||
if message_id == 21:
|
if message_id == 21:
|
||||||
return LegacyNetworkRequest(
|
return NetworkRequest(
|
||||||
type=self.read_string(reader),
|
type=self.read_string(reader),
|
||||||
method=self.read_string(reader),
|
method=self.read_string(reader),
|
||||||
url=self.read_string(reader),
|
url=self.read_string(reader),
|
||||||
|
|
@ -671,19 +671,6 @@ class MessageCodec(Codec):
|
||||||
cached=self.read_boolean(reader)
|
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:
|
if message_id == 125:
|
||||||
return IssueEvent(
|
return IssueEvent(
|
||||||
message_id=self.read_uint(reader),
|
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 timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||||
const duration = this.readUint(); if (duration === null) { return resetPointer() }
|
const duration = this.readUint(); if (duration === null) { return resetPointer() }
|
||||||
return {
|
return {
|
||||||
tp: MType.LegacyNetworkRequest,
|
tp: MType.NetworkRequest,
|
||||||
type,
|
type,
|
||||||
method,
|
method,
|
||||||
url,
|
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: {
|
case 90: {
|
||||||
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
|
||||||
const projectID = this.readUint(); if (projectID === null) { return resetPointer() }
|
const projectID = this.readUint(); if (projectID === null) { return resetPointer() }
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import type {
|
||||||
RawSetInputValue,
|
RawSetInputValue,
|
||||||
RawSetInputChecked,
|
RawSetInputChecked,
|
||||||
RawMouseMove,
|
RawMouseMove,
|
||||||
RawLegacyNetworkRequest,
|
RawNetworkRequest,
|
||||||
RawConsoleLog,
|
RawConsoleLog,
|
||||||
RawCssInsertRule,
|
RawCssInsertRule,
|
||||||
RawCssDeleteRule,
|
RawCssDeleteRule,
|
||||||
|
|
@ -58,7 +58,6 @@ import type {
|
||||||
RawSelectionChange,
|
RawSelectionChange,
|
||||||
RawMouseThrashing,
|
RawMouseThrashing,
|
||||||
RawResourceTiming,
|
RawResourceTiming,
|
||||||
RawNetworkRequest,
|
|
||||||
RawIosSessionStart,
|
RawIosSessionStart,
|
||||||
RawIosCustomEvent,
|
RawIosCustomEvent,
|
||||||
RawIosScreenChanges,
|
RawIosScreenChanges,
|
||||||
|
|
@ -105,7 +104,7 @@ export type SetInputChecked = RawSetInputChecked & Timed
|
||||||
|
|
||||||
export type MouseMove = RawMouseMove & Timed
|
export type MouseMove = RawMouseMove & Timed
|
||||||
|
|
||||||
export type LegacyNetworkRequest = RawLegacyNetworkRequest & Timed
|
export type NetworkRequest = RawNetworkRequest & Timed
|
||||||
|
|
||||||
export type ConsoleLog = RawConsoleLog & Timed
|
export type ConsoleLog = RawConsoleLog & Timed
|
||||||
|
|
||||||
|
|
@ -179,8 +178,6 @@ export type MouseThrashing = RawMouseThrashing & Timed
|
||||||
|
|
||||||
export type ResourceTiming = RawResourceTiming & Timed
|
export type ResourceTiming = RawResourceTiming & Timed
|
||||||
|
|
||||||
export type NetworkRequest = RawNetworkRequest & Timed
|
|
||||||
|
|
||||||
export type IosSessionStart = RawIosSessionStart & Timed
|
export type IosSessionStart = RawIosSessionStart & Timed
|
||||||
|
|
||||||
export type IosCustomEvent = RawIosCustomEvent & Timed
|
export type IosCustomEvent = RawIosCustomEvent & Timed
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export const enum MType {
|
||||||
SetInputValue = 18,
|
SetInputValue = 18,
|
||||||
SetInputChecked = 19,
|
SetInputChecked = 19,
|
||||||
MouseMove = 20,
|
MouseMove = 20,
|
||||||
LegacyNetworkRequest = 21,
|
NetworkRequest = 21,
|
||||||
ConsoleLog = 22,
|
ConsoleLog = 22,
|
||||||
CssInsertRule = 37,
|
CssInsertRule = 37,
|
||||||
CssDeleteRule = 38,
|
CssDeleteRule = 38,
|
||||||
|
|
@ -56,7 +56,6 @@ export const enum MType {
|
||||||
SelectionChange = 113,
|
SelectionChange = 113,
|
||||||
MouseThrashing = 114,
|
MouseThrashing = 114,
|
||||||
ResourceTiming = 116,
|
ResourceTiming = 116,
|
||||||
NetworkRequest = 117,
|
|
||||||
IosSessionStart = 90,
|
IosSessionStart = 90,
|
||||||
IosCustomEvent = 93,
|
IosCustomEvent = 93,
|
||||||
IosScreenChanges = 96,
|
IosScreenChanges = 96,
|
||||||
|
|
@ -175,8 +174,8 @@ export interface RawMouseMove {
|
||||||
y: number,
|
y: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RawLegacyNetworkRequest {
|
export interface RawNetworkRequest {
|
||||||
tp: MType.LegacyNetworkRequest,
|
tp: MType.NetworkRequest,
|
||||||
type: string,
|
type: string,
|
||||||
method: string,
|
method: string,
|
||||||
url: string,
|
url: string,
|
||||||
|
|
@ -448,19 +447,6 @@ export interface RawResourceTiming {
|
||||||
cached: boolean,
|
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 {
|
export interface RawIosSessionStart {
|
||||||
tp: MType.IosSessionStart,
|
tp: MType.IosSessionStart,
|
||||||
timestamp: number,
|
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,
|
18: MType.SetInputValue,
|
||||||
19: MType.SetInputChecked,
|
19: MType.SetInputChecked,
|
||||||
20: MType.MouseMove,
|
20: MType.MouseMove,
|
||||||
21: MType.LegacyNetworkRequest,
|
21: MType.NetworkRequest,
|
||||||
22: MType.ConsoleLog,
|
22: MType.ConsoleLog,
|
||||||
37: MType.CssInsertRule,
|
37: MType.CssInsertRule,
|
||||||
38: MType.CssDeleteRule,
|
38: MType.CssDeleteRule,
|
||||||
|
|
@ -57,7 +57,6 @@ export const TP_MAP = {
|
||||||
113: MType.SelectionChange,
|
113: MType.SelectionChange,
|
||||||
114: MType.MouseThrashing,
|
114: MType.MouseThrashing,
|
||||||
116: MType.ResourceTiming,
|
116: MType.ResourceTiming,
|
||||||
117: MType.NetworkRequest,
|
|
||||||
90: MType.IosSessionStart,
|
90: MType.IosSessionStart,
|
||||||
93: MType.IosCustomEvent,
|
93: MType.IosCustomEvent,
|
||||||
96: MType.IosScreenChanges,
|
96: MType.IosScreenChanges,
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ type TrMouseMove = [
|
||||||
y: number,
|
y: number,
|
||||||
]
|
]
|
||||||
|
|
||||||
type TrLegacyNetworkRequest = [
|
type TrNetworkRequest = [
|
||||||
type: 21,
|
type: 21,
|
||||||
type: string,
|
type: string,
|
||||||
method: string,
|
method: string,
|
||||||
|
|
@ -470,21 +470,8 @@ type TrResourceTiming = [
|
||||||
cached: boolean,
|
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 | 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 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 default function translate(tMsg: TrackerMessage): RawMessage | null {
|
export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
||||||
switch(tMsg[0]) {
|
switch(tMsg[0]) {
|
||||||
|
|
@ -625,7 +612,7 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
||||||
|
|
||||||
case 21: {
|
case 21: {
|
||||||
return {
|
return {
|
||||||
tp: MType.LegacyNetworkRequest,
|
tp: MType.NetworkRequest,
|
||||||
type: tMsg[1],
|
type: tMsg[1],
|
||||||
method: tMsg[2],
|
method: tMsg[2],
|
||||||
url: tMsg[3],
|
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:
|
default:
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ message 20, 'MouseMove' do
|
||||||
uint 'X'
|
uint 'X'
|
||||||
uint 'Y'
|
uint 'Y'
|
||||||
end
|
end
|
||||||
message 21, 'LegacyNetworkRequest', :replayer => :devtools do
|
message 21, 'NetworkRequest', :replayer => :devtools do
|
||||||
string 'Type' # fetch/xhr/anythingElse(axios,gql,fonts,image?)
|
string 'Type' # fetch/xhr/anythingElse(axios,gql,fonts,image?)
|
||||||
string 'Method'
|
string 'Method'
|
||||||
string 'URL'
|
string 'URL'
|
||||||
|
|
@ -484,20 +484,6 @@ message 116, 'ResourceTiming', :replayer => :devtools do
|
||||||
boolean 'Cached'
|
boolean 'Cached'
|
||||||
end
|
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
|
## Backend-only
|
||||||
message 125, 'IssueEvent', :replayer => false, :tracker => false do
|
message 125, 'IssueEvent', :replayer => false, :tracker => false do
|
||||||
uint 'MessageID'
|
uint 'MessageID'
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export declare const enum Type {
|
||||||
SetInputValue = 18,
|
SetInputValue = 18,
|
||||||
SetInputChecked = 19,
|
SetInputChecked = 19,
|
||||||
MouseMove = 20,
|
MouseMove = 20,
|
||||||
LegacyNetworkRequest = 21,
|
NetworkRequest = 21,
|
||||||
ConsoleLog = 22,
|
ConsoleLog = 22,
|
||||||
PageLoadTiming = 23,
|
PageLoadTiming = 23,
|
||||||
PageRenderTiming = 24,
|
PageRenderTiming = 24,
|
||||||
|
|
@ -68,7 +68,6 @@ export declare const enum Type {
|
||||||
MouseThrashing = 114,
|
MouseThrashing = 114,
|
||||||
UnbindNodes = 115,
|
UnbindNodes = 115,
|
||||||
ResourceTiming = 116,
|
ResourceTiming = 116,
|
||||||
NetworkRequest = 117,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -180,8 +179,8 @@ export type MouseMove = [
|
||||||
/*y:*/ number,
|
/*y:*/ number,
|
||||||
]
|
]
|
||||||
|
|
||||||
export type LegacyNetworkRequest = [
|
export type NetworkRequest = [
|
||||||
/*type:*/ Type.LegacyNetworkRequest,
|
/*type:*/ Type.NetworkRequest,
|
||||||
/*type:*/ string,
|
/*type:*/ string,
|
||||||
/*method:*/ string,
|
/*method:*/ string,
|
||||||
/*url:*/ string,
|
/*url:*/ string,
|
||||||
|
|
@ -537,19 +536,6 @@ export type ResourceTiming = [
|
||||||
/*cached:*/ boolean,
|
/*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 | 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
|
||||||
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
|
|
||||||
export default Message
|
export default Message
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ export function MouseMove(
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LegacyNetworkRequest(
|
export function NetworkRequest(
|
||||||
type: string,
|
type: string,
|
||||||
method: string,
|
method: string,
|
||||||
url: string,
|
url: string,
|
||||||
|
|
@ -213,9 +213,9 @@ export function LegacyNetworkRequest(
|
||||||
status: number,
|
status: number,
|
||||||
timestamp: number,
|
timestamp: number,
|
||||||
duration: number,
|
duration: number,
|
||||||
): Messages.LegacyNetworkRequest {
|
): Messages.NetworkRequest {
|
||||||
return [
|
return [
|
||||||
Messages.Type.LegacyNetworkRequest,
|
Messages.Type.NetworkRequest,
|
||||||
type,
|
type,
|
||||||
method,
|
method,
|
||||||
url,
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const isCached = r.status === 304 || checkCacheByPerformanceTimings(reqResInfo.url)
|
|
||||||
app.send(
|
app.send(
|
||||||
NetworkRequest(
|
NetworkRequest(
|
||||||
'fetch',
|
'fetch',
|
||||||
|
|
@ -230,7 +229,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
||||||
r.status,
|
r.status,
|
||||||
startTime + getTimeOrigin(),
|
startTime + getTimeOrigin(),
|
||||||
duration,
|
duration,
|
||||||
isCached,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
@ -287,8 +285,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const isCached =
|
|
||||||
xhr.status === 304 || (xhr.status < 400 && checkCacheByPerformanceTimings(reqResInfo.url))
|
|
||||||
app.send(
|
app.send(
|
||||||
NetworkRequest(
|
NetworkRequest(
|
||||||
'xhr',
|
'xhr',
|
||||||
|
|
@ -299,7 +295,6 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
||||||
xhr.status,
|
xhr.status,
|
||||||
startTime + getTimeOrigin(),
|
startTime + getTimeOrigin(),
|
||||||
duration,
|
duration,
|
||||||
isCached,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
||||||
return this.uint(msg[1]) && this.uint(msg[2])
|
return this.uint(msg[1]) && this.uint(msg[2])
|
||||||
break
|
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])
|
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
|
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])
|
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
|
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