-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging lcp target #607
base: master
Are you sure you want to change the base?
Logging lcp target #607
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "clarity", | ||
"private": true, | ||
"version": "0.7.47", | ||
"version": "0.7.48", | ||
"repository": "https://github.com/microsoft/clarity.git", | ||
"author": "Sarvesh Nagpal <[email protected]>", | ||
"license": "MIT", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
let version = "0.7.47"; | ||
let version = "0.7.48"; | ||
export default version; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Code, Constant, Dimension, Metric, Severity } from "@clarity-types/data"; | ||
import { Code, Constant, Dimension, Event, Metric, Severity } from "@clarity-types/data"; | ||
import config from "@src/core/config"; | ||
import { bind } from "@src/core/event"; | ||
import measure from "@src/core/measure"; | ||
|
@@ -7,6 +7,8 @@ import * as dimension from "@src/data/dimension"; | |
import * as metric from "@src/data/metric"; | ||
import * as internal from "@src/diagnostic/internal"; | ||
import * as navigation from "@src/performance/navigation"; | ||
import * as dom from "@src/layout/dom"; | ||
|
||
|
||
let observer: PerformanceObserver; | ||
const types: string[] = [Constant.Navigation, Constant.Resource, Constant.LongTask, Constant.FID, Constant.CLS, Constant.LCP, Constant.PerformanceEventTiming]; | ||
|
@@ -81,6 +83,10 @@ function process(entries: PerformanceEntryList): void { | |
break; | ||
case Constant.LCP: | ||
if (visible) { metric.max(Metric.LargestPaint, entry.startTime); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to only log targetNode if it is visible? not sure why we log the metric when visible, but the rest of it regardless |
||
const targetNode = dom.get((entry as any).element)?.id | ||
if(targetNode){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, space between if and ( |
||
metric.logTarget(Event.LargestPaintTarget, targetNode) | ||
} | ||
break; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
triple ===