You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check if the tuple is valid and response size exists
413
+
sizes_tuple=parse_network_content_lengths(event)
414
+
response_size=None
415
+
ifsizes_tupleandsizes_tuple[1] isnotNone:
416
+
response_size=str(sizes_tuple[1])
417
+
418
+
# Skip successful requests
419
+
ifstatus_codeandstr(status_code).startswith("2"):
420
+
returnNone
421
+
422
+
ifresponse_sizeisNone:
423
+
returnf'Application initiated request: "{method}{path} HTTP/2.0" with status code {status_code}; took {duration} milliseconds at {timestamp_ms}'
424
+
else:
425
+
returnf'Application initiated request: "{method}{path} HTTP/2.0" with status code {status_code} and response size {response_size}; took {duration} milliseconds at {timestamp_ms}'
426
+
caseEventType.LCP:
427
+
timestamp_ms=timestamp*1000
428
+
duration=event["data"]["payload"]["data"]["size"]
429
+
rating=event["data"]["payload"]["data"]["rating"]
430
+
returnf"Application largest contentful paint: {duration} ms and has a {rating} rating at {timestamp_ms}"
431
+
caseEventType.FCP:
432
+
timestamp_ms=timestamp*1000
433
+
duration=event["data"]["payload"]["data"]["size"]
434
+
rating=event["data"]["payload"]["data"]["rating"]
435
+
returnf"Application first contentful paint: {duration} ms and has a {rating} rating at {timestamp_ms}"
436
+
caseEventType.HYDRATION_ERROR:
437
+
returnf"There was a hydration error on the page at {timestamp}"
438
+
caseEventType.RESOURCE_XHR:
415
439
returnNone
416
-
417
-
ifresponse_sizeisNone:
418
-
returnf'Application initiated request: "{method}{path} HTTP/2.0" with status code {status_code}; took {duration} milliseconds at {timestamp_ms}'
419
-
else:
420
-
returnf'Application initiated request: "{method}{path} HTTP/2.0" with status code {status_code} and response size {response_size}; took {duration} milliseconds at {timestamp_ms}'
421
-
caseEventType.RESOURCE_XHR:
422
-
returnNone
423
-
caseEventType.LCP:
424
-
timestamp_ms=timestamp*1000
425
-
duration=event["data"]["payload"]["data"]["size"]
426
-
rating=event["data"]["payload"]["data"]["rating"]
427
-
returnf"Application largest contentful paint: {duration} ms and has a {rating} rating at {timestamp_ms}"
428
-
caseEventType.FCP:
429
-
timestamp_ms=timestamp*1000
430
-
duration=event["data"]["payload"]["data"]["size"]
431
-
rating=event["data"]["payload"]["data"]["rating"]
432
-
returnf"Application first contentful paint: {duration} ms and has a {rating} rating at {timestamp_ms}"
433
-
caseEventType.HYDRATION_ERROR:
434
-
returnf"There was a hydration error on the page at {timestamp}"
435
-
caseEventType.MUTATIONS:
436
-
returnNone
437
-
caseEventType.UNKNOWN:
438
-
returnNone
439
-
caseEventType.CANVAS:
440
-
returnNone
441
-
caseEventType.OPTIONS:
442
-
returnNone
443
-
caseEventType.FEEDBACK:
444
-
returnNone# the log message is processed before this method is called
440
+
caseEventType.MUTATIONS:
441
+
returnNone
442
+
caseEventType.UNKNOWN:
443
+
returnNone
444
+
caseEventType.CANVAS:
445
+
returnNone
446
+
caseEventType.OPTIONS:
447
+
returnNone
448
+
caseEventType.FEEDBACK:
449
+
returnNone# the log message is processed before this method is called
0 commit comments