change(tracker): regen messages; add trans size and isCache to resource timing message, remove x-cached header detection
This commit is contained in:
parent
2f1b233070
commit
89ec4b67f1
15 changed files with 521 additions and 166 deletions
|
|
@ -48,7 +48,7 @@ const (
|
|||
MsgPerformanceTrack = 49
|
||||
MsgStringDict = 50
|
||||
MsgSetNodeAttributeDict = 51
|
||||
MsgResourceTiming = 53
|
||||
MsgResourceTimingLegacy = 53
|
||||
MsgConnectionInformation = 54
|
||||
MsgSetPageVisibility = 55
|
||||
MsgPerformanceTrackAggr = 56
|
||||
|
|
@ -80,10 +80,11 @@ const (
|
|||
MsgSelectionChange = 113
|
||||
MsgMouseThrashing = 114
|
||||
MsgUnbindNodes = 115
|
||||
MsgResourceTiming = 116
|
||||
MsgNetworkRequest = 117
|
||||
MsgIssueEvent = 125
|
||||
MsgSessionEnd = 126
|
||||
MsgSessionSearch = 127
|
||||
MsgNetworkRequest = 128
|
||||
MsgIOSBatchMeta = 107
|
||||
MsgIOSSessionStart = 90
|
||||
MsgIOSSessionEnd = 91
|
||||
|
|
@ -1296,7 +1297,7 @@ func (msg *SetNodeAttributeDict) TypeID() int {
|
|||
return 51
|
||||
}
|
||||
|
||||
type ResourceTiming struct {
|
||||
type ResourceTimingLegacy struct {
|
||||
message
|
||||
Timestamp uint64
|
||||
Duration uint64
|
||||
|
|
@ -1308,7 +1309,7 @@ type ResourceTiming struct {
|
|||
Initiator string
|
||||
}
|
||||
|
||||
func (msg *ResourceTiming) Encode() []byte {
|
||||
func (msg *ResourceTimingLegacy) Encode() []byte {
|
||||
buf := make([]byte, 81+len(msg.URL)+len(msg.Initiator))
|
||||
buf[0] = 53
|
||||
p := 1
|
||||
|
|
@ -1323,11 +1324,11 @@ func (msg *ResourceTiming) Encode() []byte {
|
|||
return buf[:p]
|
||||
}
|
||||
|
||||
func (msg *ResourceTiming) Decode() Message {
|
||||
func (msg *ResourceTimingLegacy) Decode() Message {
|
||||
return msg
|
||||
}
|
||||
|
||||
func (msg *ResourceTiming) TypeID() int {
|
||||
func (msg *ResourceTimingLegacy) TypeID() int {
|
||||
return 53
|
||||
}
|
||||
|
||||
|
|
@ -2124,6 +2125,82 @@ func (msg *UnbindNodes) TypeID() int {
|
|||
return 115
|
||||
}
|
||||
|
||||
type ResourceTiming struct {
|
||||
message
|
||||
Timestamp uint64
|
||||
Duration uint64
|
||||
TTFB uint64
|
||||
HeaderSize uint64
|
||||
EncodedBodySize uint64
|
||||
DecodedBodySize uint64
|
||||
URL string
|
||||
Initiator string
|
||||
TransferredSize uint64
|
||||
Cached bool
|
||||
}
|
||||
|
||||
func (msg *ResourceTiming) Encode() []byte {
|
||||
buf := make([]byte, 101+len(msg.URL)+len(msg.Initiator))
|
||||
buf[0] = 116
|
||||
p := 1
|
||||
p = WriteUint(msg.Timestamp, buf, p)
|
||||
p = WriteUint(msg.Duration, buf, p)
|
||||
p = WriteUint(msg.TTFB, buf, p)
|
||||
p = WriteUint(msg.HeaderSize, buf, p)
|
||||
p = WriteUint(msg.EncodedBodySize, buf, p)
|
||||
p = WriteUint(msg.DecodedBodySize, buf, p)
|
||||
p = WriteString(msg.URL, buf, p)
|
||||
p = WriteString(msg.Initiator, buf, p)
|
||||
p = WriteUint(msg.TransferredSize, buf, p)
|
||||
p = WriteBoolean(msg.Cached, buf, p)
|
||||
return buf[:p]
|
||||
}
|
||||
|
||||
func (msg *ResourceTiming) Decode() Message {
|
||||
return msg
|
||||
}
|
||||
|
||||
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
|
||||
|
|
@ -2203,43 +2280,6 @@ func (msg *SessionSearch) TypeID() int {
|
|||
return 127
|
||||
}
|
||||
|
||||
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] = 128
|
||||
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 128
|
||||
}
|
||||
|
||||
type IOSBatchMeta struct {
|
||||
message
|
||||
Timestamp uint64
|
||||
|
|
|
|||
|
|
@ -756,9 +756,9 @@ func DecodeSetNodeAttributeDict(reader BytesReader) (Message, error) {
|
|||
return msg, err
|
||||
}
|
||||
|
||||
func DecodeResourceTiming(reader BytesReader) (Message, error) {
|
||||
func DecodeResourceTimingLegacy(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &ResourceTiming{}
|
||||
msg := &ResourceTimingLegacy{}
|
||||
if msg.Timestamp, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1278,6 +1278,75 @@ func DecodeUnbindNodes(reader BytesReader) (Message, error) {
|
|||
return msg, err
|
||||
}
|
||||
|
||||
func DecodeResourceTiming(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &ResourceTiming{}
|
||||
if msg.Timestamp, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Duration, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.TTFB, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.HeaderSize, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.EncodedBodySize, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.DecodedBodySize, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.URL, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Initiator, err = reader.ReadString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.TransferredSize, err = reader.ReadUint(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if msg.Cached, err = reader.ReadBoolean(); err != nil {
|
||||
return nil, 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) {
|
||||
var err error = nil
|
||||
msg := &IssueEvent{}
|
||||
|
|
@ -1329,39 +1398,6 @@ func DecodeSessionSearch(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 DecodeIOSBatchMeta(reader BytesReader) (Message, error) {
|
||||
var err error = nil
|
||||
msg := &IOSBatchMeta{}
|
||||
|
|
@ -1859,7 +1895,7 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
case 51:
|
||||
return DecodeSetNodeAttributeDict(reader)
|
||||
case 53:
|
||||
return DecodeResourceTiming(reader)
|
||||
return DecodeResourceTimingLegacy(reader)
|
||||
case 54:
|
||||
return DecodeConnectionInformation(reader)
|
||||
case 55:
|
||||
|
|
@ -1922,14 +1958,16 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
return DecodeMouseThrashing(reader)
|
||||
case 115:
|
||||
return DecodeUnbindNodes(reader)
|
||||
case 116:
|
||||
return DecodeResourceTiming(reader)
|
||||
case 117:
|
||||
return DecodeNetworkRequest(reader)
|
||||
case 125:
|
||||
return DecodeIssueEvent(reader)
|
||||
case 126:
|
||||
return DecodeSessionEnd(reader)
|
||||
case 127:
|
||||
return DecodeSessionSearch(reader)
|
||||
case 128:
|
||||
return DecodeNetworkRequest(reader)
|
||||
case 107:
|
||||
return DecodeIOSBatchMeta(reader)
|
||||
case 90:
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ class SetNodeAttributeDict(Message):
|
|||
self.value_key = value_key
|
||||
|
||||
|
||||
class ResourceTiming(Message):
|
||||
class ResourceTimingLegacy(Message):
|
||||
__id__ = 53
|
||||
|
||||
def __init__(self, timestamp, duration, ttfb, header_size, encoded_body_size, decoded_body_size, url, initiator):
|
||||
|
|
@ -743,6 +743,37 @@ class UnbindNodes(Message):
|
|||
self.total_removed_percent = total_removed_percent
|
||||
|
||||
|
||||
class ResourceTiming(Message):
|
||||
__id__ = 116
|
||||
|
||||
def __init__(self, timestamp, duration, ttfb, header_size, encoded_body_size, decoded_body_size, url, initiator, transferred_size, cached):
|
||||
self.timestamp = timestamp
|
||||
self.duration = duration
|
||||
self.ttfb = ttfb
|
||||
self.header_size = header_size
|
||||
self.encoded_body_size = encoded_body_size
|
||||
self.decoded_body_size = decoded_body_size
|
||||
self.url = url
|
||||
self.initiator = initiator
|
||||
self.transferred_size = transferred_size
|
||||
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
|
||||
|
||||
|
|
@ -772,21 +803,6 @@ class SessionSearch(Message):
|
|||
self.partition = partition
|
||||
|
||||
|
||||
class NetworkRequest(Message):
|
||||
__id__ = 128
|
||||
|
||||
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 IOSBatchMeta(Message):
|
||||
__id__ = 107
|
||||
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ class MessageCodec(Codec):
|
|||
)
|
||||
|
||||
if message_id == 53:
|
||||
return ResourceTiming(
|
||||
return ResourceTimingLegacy(
|
||||
timestamp=self.read_uint(reader),
|
||||
duration=self.read_uint(reader),
|
||||
ttfb=self.read_uint(reader),
|
||||
|
|
@ -657,6 +657,33 @@ class MessageCodec(Codec):
|
|||
total_removed_percent=self.read_uint(reader)
|
||||
)
|
||||
|
||||
if message_id == 116:
|
||||
return ResourceTiming(
|
||||
timestamp=self.read_uint(reader),
|
||||
duration=self.read_uint(reader),
|
||||
ttfb=self.read_uint(reader),
|
||||
header_size=self.read_uint(reader),
|
||||
encoded_body_size=self.read_uint(reader),
|
||||
decoded_body_size=self.read_uint(reader),
|
||||
url=self.read_string(reader),
|
||||
initiator=self.read_string(reader),
|
||||
transferred_size=self.read_uint(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:
|
||||
return IssueEvent(
|
||||
message_id=self.read_uint(reader),
|
||||
|
|
@ -680,19 +707,6 @@ class MessageCodec(Codec):
|
|||
partition=self.read_uint(reader)
|
||||
)
|
||||
|
||||
if message_id == 128:
|
||||
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 == 107:
|
||||
return IOSBatchMeta(
|
||||
timestamp=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.NetworkRequest,
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
|
|
@ -403,7 +403,7 @@ export default class RawMessageReader extends PrimitiveReader {
|
|||
const url = this.readString(); if (url === null) { return resetPointer() }
|
||||
const initiator = this.readString(); if (initiator === null) { return resetPointer() }
|
||||
return {
|
||||
tp: MType.ResourceTiming,
|
||||
tp: MType.ResourceTimingLegacy,
|
||||
timestamp,
|
||||
duration,
|
||||
ttfb,
|
||||
|
|
@ -647,6 +647,56 @@ export default class RawMessageReader extends PrimitiveReader {
|
|||
};
|
||||
}
|
||||
|
||||
case 116: {
|
||||
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() }
|
||||
const transferredSize = this.readUint(); if (transferredSize === null) { return resetPointer() }
|
||||
const cached = this.readBoolean(); if (cached === null) { return resetPointer() }
|
||||
return {
|
||||
tp: MType.ResourceTiming,
|
||||
timestamp,
|
||||
duration,
|
||||
ttfb,
|
||||
headerSize,
|
||||
encodedBodySize,
|
||||
decodedBodySize,
|
||||
url,
|
||||
initiator,
|
||||
transferredSize,
|
||||
cached,
|
||||
};
|
||||
}
|
||||
|
||||
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,
|
||||
RawNetworkRequest,
|
||||
RawLegacyNetworkRequest,
|
||||
RawConsoleLog,
|
||||
RawCssInsertRule,
|
||||
RawCssDeleteRule,
|
||||
|
|
@ -36,7 +36,7 @@ import type {
|
|||
RawPerformanceTrack,
|
||||
RawStringDict,
|
||||
RawSetNodeAttributeDict,
|
||||
RawResourceTiming,
|
||||
RawResourceTimingLegacy,
|
||||
RawConnectionInformation,
|
||||
RawSetPageVisibility,
|
||||
RawLoadFontFace,
|
||||
|
|
@ -57,6 +57,8 @@ import type {
|
|||
RawZustand,
|
||||
RawSelectionChange,
|
||||
RawMouseThrashing,
|
||||
RawResourceTiming,
|
||||
RawNetworkRequest,
|
||||
RawIosSessionStart,
|
||||
RawIosCustomEvent,
|
||||
RawIosScreenChanges,
|
||||
|
|
@ -103,7 +105,7 @@ export type SetInputChecked = RawSetInputChecked & Timed
|
|||
|
||||
export type MouseMove = RawMouseMove & Timed
|
||||
|
||||
export type NetworkRequest = RawNetworkRequest & Timed
|
||||
export type LegacyNetworkRequest = RawLegacyNetworkRequest & Timed
|
||||
|
||||
export type ConsoleLog = RawConsoleLog & Timed
|
||||
|
||||
|
|
@ -133,7 +135,7 @@ export type StringDict = RawStringDict & Timed
|
|||
|
||||
export type SetNodeAttributeDict = RawSetNodeAttributeDict & Timed
|
||||
|
||||
export type ResourceTiming = RawResourceTiming & Timed
|
||||
export type ResourceTimingLegacy = RawResourceTimingLegacy & Timed
|
||||
|
||||
export type ConnectionInformation = RawConnectionInformation & Timed
|
||||
|
||||
|
|
@ -175,6 +177,10 @@ export type SelectionChange = RawSelectionChange & Timed
|
|||
|
||||
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,
|
||||
NetworkRequest = 21,
|
||||
LegacyNetworkRequest = 21,
|
||||
ConsoleLog = 22,
|
||||
CssInsertRule = 37,
|
||||
CssDeleteRule = 38,
|
||||
|
|
@ -34,7 +34,7 @@ export const enum MType {
|
|||
PerformanceTrack = 49,
|
||||
StringDict = 50,
|
||||
SetNodeAttributeDict = 51,
|
||||
ResourceTiming = 53,
|
||||
ResourceTimingLegacy = 53,
|
||||
ConnectionInformation = 54,
|
||||
SetPageVisibility = 55,
|
||||
LoadFontFace = 57,
|
||||
|
|
@ -55,6 +55,8 @@ export const enum MType {
|
|||
Zustand = 79,
|
||||
SelectionChange = 113,
|
||||
MouseThrashing = 114,
|
||||
ResourceTiming = 116,
|
||||
NetworkRequest = 117,
|
||||
IosSessionStart = 90,
|
||||
IosCustomEvent = 93,
|
||||
IosScreenChanges = 96,
|
||||
|
|
@ -173,8 +175,8 @@ export interface RawMouseMove {
|
|||
y: number,
|
||||
}
|
||||
|
||||
export interface RawNetworkRequest {
|
||||
tp: MType.NetworkRequest,
|
||||
export interface RawLegacyNetworkRequest {
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
|
|
@ -284,8 +286,8 @@ export interface RawSetNodeAttributeDict {
|
|||
valueKey: number,
|
||||
}
|
||||
|
||||
export interface RawResourceTiming {
|
||||
tp: MType.ResourceTiming,
|
||||
export interface RawResourceTimingLegacy {
|
||||
tp: MType.ResourceTimingLegacy,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
ttfb: number,
|
||||
|
|
@ -432,6 +434,33 @@ export interface RawMouseThrashing {
|
|||
timestamp: number,
|
||||
}
|
||||
|
||||
export interface RawResourceTiming {
|
||||
tp: MType.ResourceTiming,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
ttfb: number,
|
||||
headerSize: number,
|
||||
encodedBodySize: number,
|
||||
decodedBodySize: number,
|
||||
url: string,
|
||||
initiator: string,
|
||||
transferredSize: number,
|
||||
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,
|
||||
|
|
@ -503,4 +532,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 | RawStringDict | RawSetNodeAttributeDict | RawResourceTiming | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawSelectionChange | RawMouseThrashing | 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 | RawLegacyNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingLegacy | 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;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export const TP_MAP = {
|
|||
18: MType.SetInputValue,
|
||||
19: MType.SetInputChecked,
|
||||
20: MType.MouseMove,
|
||||
21: MType.NetworkRequest,
|
||||
21: MType.LegacyNetworkRequest,
|
||||
22: MType.ConsoleLog,
|
||||
37: MType.CssInsertRule,
|
||||
38: MType.CssDeleteRule,
|
||||
|
|
@ -35,7 +35,7 @@ export const TP_MAP = {
|
|||
49: MType.PerformanceTrack,
|
||||
50: MType.StringDict,
|
||||
51: MType.SetNodeAttributeDict,
|
||||
53: MType.ResourceTiming,
|
||||
53: MType.ResourceTimingLegacy,
|
||||
54: MType.ConnectionInformation,
|
||||
55: MType.SetPageVisibility,
|
||||
57: MType.LoadFontFace,
|
||||
|
|
@ -56,6 +56,8 @@ export const TP_MAP = {
|
|||
79: MType.Zustand,
|
||||
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 TrNetworkRequest = [
|
||||
type TrLegacyNetworkRequest = [
|
||||
type: 21,
|
||||
type: string,
|
||||
method: string,
|
||||
|
|
@ -271,7 +271,7 @@ type TrSetNodeAttributeDict = [
|
|||
valueKey: number,
|
||||
]
|
||||
|
||||
type TrResourceTiming = [
|
||||
type TrResourceTimingLegacy = [
|
||||
type: 53,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
|
|
@ -456,8 +456,35 @@ type TrUnbindNodes = [
|
|||
totalRemovedPercent: number,
|
||||
]
|
||||
|
||||
type TrResourceTiming = [
|
||||
type: 116,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
ttfb: number,
|
||||
headerSize: number,
|
||||
encodedBodySize: number,
|
||||
decodedBodySize: number,
|
||||
url: string,
|
||||
initiator: string,
|
||||
transferredSize: 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 | TrResourceTiming | 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
|
||||
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 | TrResourceTimingLegacy | 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 {
|
||||
switch(tMsg[0]) {
|
||||
|
|
@ -598,7 +625,7 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
|||
|
||||
case 21: {
|
||||
return {
|
||||
tp: MType.NetworkRequest,
|
||||
tp: MType.LegacyNetworkRequest,
|
||||
type: tMsg[1],
|
||||
method: tMsg[2],
|
||||
url: tMsg[3],
|
||||
|
|
@ -739,7 +766,7 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
|||
|
||||
case 53: {
|
||||
return {
|
||||
tp: MType.ResourceTiming,
|
||||
tp: MType.ResourceTimingLegacy,
|
||||
timestamp: tMsg[1],
|
||||
duration: tMsg[2],
|
||||
ttfb: tMsg[3],
|
||||
|
|
@ -910,6 +937,37 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
|||
}
|
||||
}
|
||||
|
||||
case 116: {
|
||||
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],
|
||||
transferredSize: tMsg[9],
|
||||
cached: tMsg[10],
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ message 51, "SetNodeAttributeDict" do
|
|||
uint 'NameKey'
|
||||
uint 'ValueKey'
|
||||
end
|
||||
message 53, 'ResourceTiming', :replayer => :devtools do
|
||||
message 53, 'ResourceTimingLegacy', :replayer => :devtools do
|
||||
uint 'Timestamp'
|
||||
uint 'Duration'
|
||||
uint 'TTFB'
|
||||
|
|
@ -471,6 +471,33 @@ message 115, 'UnbindNodes', :replayer => false do
|
|||
uint 'TotalRemovedPercent'
|
||||
end
|
||||
|
||||
message 116, 'ResourceTiming', :replayer => :devtools do
|
||||
uint 'Timestamp'
|
||||
uint 'Duration'
|
||||
uint 'TTFB'
|
||||
uint 'HeaderSize'
|
||||
uint 'EncodedBodySize'
|
||||
uint 'DecodedBodySize'
|
||||
string 'URL'
|
||||
string 'Initiator'
|
||||
uint 'TransferredSize'
|
||||
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'
|
||||
|
|
@ -489,15 +516,3 @@ message 127, 'SessionSearch', :tracker => false, :replayer => false do
|
|||
uint 'Timestamp'
|
||||
uint 'Partition'
|
||||
end
|
||||
|
||||
message 128, '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
|
||||
|
|
@ -19,7 +19,7 @@ export declare const enum Type {
|
|||
SetInputValue = 18,
|
||||
SetInputChecked = 19,
|
||||
MouseMove = 20,
|
||||
NetworkRequest = 21,
|
||||
LegacyNetworkRequest = 21,
|
||||
ConsoleLog = 22,
|
||||
PageLoadTiming = 23,
|
||||
PageRenderTiming = 24,
|
||||
|
|
@ -41,7 +41,7 @@ export declare const enum Type {
|
|||
PerformanceTrack = 49,
|
||||
StringDict = 50,
|
||||
SetNodeAttributeDict = 51,
|
||||
ResourceTiming = 53,
|
||||
ResourceTimingLegacy = 53,
|
||||
ConnectionInformation = 54,
|
||||
SetPageVisibility = 55,
|
||||
LoadFontFace = 57,
|
||||
|
|
@ -67,6 +67,8 @@ export declare const enum Type {
|
|||
SelectionChange = 113,
|
||||
MouseThrashing = 114,
|
||||
UnbindNodes = 115,
|
||||
ResourceTiming = 116,
|
||||
NetworkRequest = 117,
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -178,8 +180,8 @@ export type MouseMove = [
|
|||
/*y:*/ number,
|
||||
]
|
||||
|
||||
export type NetworkRequest = [
|
||||
/*type:*/ Type.NetworkRequest,
|
||||
export type LegacyNetworkRequest = [
|
||||
/*type:*/ Type.LegacyNetworkRequest,
|
||||
/*type:*/ string,
|
||||
/*method:*/ string,
|
||||
/*url:*/ string,
|
||||
|
|
@ -336,8 +338,8 @@ export type SetNodeAttributeDict = [
|
|||
/*valueKey:*/ number,
|
||||
]
|
||||
|
||||
export type ResourceTiming = [
|
||||
/*type:*/ Type.ResourceTiming,
|
||||
export type ResourceTimingLegacy = [
|
||||
/*type:*/ Type.ResourceTimingLegacy,
|
||||
/*timestamp:*/ number,
|
||||
/*duration:*/ number,
|
||||
/*ttfb:*/ number,
|
||||
|
|
@ -521,6 +523,33 @@ export type UnbindNodes = [
|
|||
/*totalRemovedPercent:*/ number,
|
||||
]
|
||||
|
||||
export type ResourceTiming = [
|
||||
/*type:*/ Type.ResourceTiming,
|
||||
/*timestamp:*/ number,
|
||||
/*duration:*/ number,
|
||||
/*ttfb:*/ number,
|
||||
/*headerSize:*/ number,
|
||||
/*encodedBodySize:*/ number,
|
||||
/*decodedBodySize:*/ number,
|
||||
/*url:*/ string,
|
||||
/*initiator:*/ string,
|
||||
/*transferredSize:*/ 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 | ResourceTiming | 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
|
||||
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 | ResourceTimingLegacy | 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
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ export function MouseMove(
|
|||
]
|
||||
}
|
||||
|
||||
export function NetworkRequest(
|
||||
export function LegacyNetworkRequest(
|
||||
type: string,
|
||||
method: string,
|
||||
url: string,
|
||||
|
|
@ -213,9 +213,9 @@ export function NetworkRequest(
|
|||
status: number,
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
): Messages.NetworkRequest {
|
||||
): Messages.LegacyNetworkRequest {
|
||||
return [
|
||||
Messages.Type.NetworkRequest,
|
||||
Messages.Type.LegacyNetworkRequest,
|
||||
type,
|
||||
method,
|
||||
url,
|
||||
|
|
@ -498,7 +498,7 @@ export function SetNodeAttributeDict(
|
|||
]
|
||||
}
|
||||
|
||||
export function ResourceTiming(
|
||||
export function ResourceTimingLegacy(
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
ttfb: number,
|
||||
|
|
@ -507,9 +507,9 @@ export function ResourceTiming(
|
|||
decodedBodySize: number,
|
||||
url: string,
|
||||
initiator: string,
|
||||
): Messages.ResourceTiming {
|
||||
): Messages.ResourceTimingLegacy {
|
||||
return [
|
||||
Messages.Type.ResourceTiming,
|
||||
Messages.Type.ResourceTimingLegacy,
|
||||
timestamp,
|
||||
duration,
|
||||
ttfb,
|
||||
|
|
@ -842,3 +842,55 @@ export function UnbindNodes(
|
|||
]
|
||||
}
|
||||
|
||||
export function ResourceTiming(
|
||||
timestamp: number,
|
||||
duration: number,
|
||||
ttfb: number,
|
||||
headerSize: number,
|
||||
encodedBodySize: number,
|
||||
decodedBodySize: number,
|
||||
url: string,
|
||||
initiator: string,
|
||||
transferredSize: number,
|
||||
cached: boolean,
|
||||
): Messages.ResourceTiming {
|
||||
return [
|
||||
Messages.Type.ResourceTiming,
|
||||
timestamp,
|
||||
duration,
|
||||
ttfb,
|
||||
headerSize,
|
||||
encodedBodySize,
|
||||
decodedBodySize,
|
||||
url,
|
||||
initiator,
|
||||
transferredSize,
|
||||
cached,
|
||||
]
|
||||
}
|
||||
|
||||
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,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -217,10 +217,7 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
return
|
||||
}
|
||||
|
||||
const isCached =
|
||||
r.status === 304 ||
|
||||
reqHs['x-cache'].includes('Hit') ||
|
||||
checkCacheByPerformanceTimings(reqResInfo.url)
|
||||
const isCached = r.status === 304 || checkCacheByPerformanceTimings(reqResInfo.url)
|
||||
app.send(
|
||||
NetworkRequest(
|
||||
'fetch',
|
||||
|
|
@ -289,9 +286,7 @@ export default function (app: App, opts: Partial<Options> = {}) {
|
|||
}
|
||||
|
||||
const isCached =
|
||||
xhr.status === 304 ||
|
||||
reqHs['x-cache'].includes('Hit') ||
|
||||
(xhr.status < 400 && checkCacheByPerformanceTimings(reqResInfo.url))
|
||||
xhr.status === 304 || (xhr.status < 400 && checkCacheByPerformanceTimings(reqResInfo.url))
|
||||
app.send(
|
||||
NetworkRequest(
|
||||
'xhr',
|
||||
|
|
|
|||
|
|
@ -118,6 +118,9 @@ export default function (app: App, opts: Partial<Options>): void {
|
|||
entry.decodedBodySize || 0,
|
||||
entry.name,
|
||||
entry.initiatorType,
|
||||
entry.transferSize,
|
||||
// @ts-ignore
|
||||
(entry.responseStatus && entry.responseStatus === 304) || entry.transferSize === 0,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
|||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
case Messages.Type.NetworkRequest:
|
||||
case Messages.Type.LegacyNetworkRequest:
|
||||
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
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
|||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
case Messages.Type.ResourceTiming:
|
||||
case Messages.Type.ResourceTimingLegacy:
|
||||
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])
|
||||
break
|
||||
|
||||
|
|
@ -270,6 +270,14 @@ export default class MessageEncoder extends PrimitiveEncoder {
|
|||
return this.uint(msg[1])
|
||||
break
|
||||
|
||||
case Messages.Type.ResourceTiming:
|
||||
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