This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-client-js.git
The following commit(s) were added to refs/heads/master by this push:
new 3a88220 distinguish empty (#158)
3a88220 is described below
commit 3a88220ba3f81000c912f9c04d4e6aecf81b9f9f
Author: Fine0830 <[email protected]>
AuthorDate: Thu Feb 13 13:54:41 2025 +0800
distinguish empty (#158)
---
src/performance/index.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/performance/index.ts b/src/performance/index.ts
index 9d914e9..0901bd8 100644
--- a/src/performance/index.ts
+++ b/src/performance/index.ts
@@ -122,12 +122,12 @@ class TracePerf {
this.INP();
this.CLS();
setTimeout(() => {
- this.coreWebMetrics.fmpTime = Math.floor(FMP.fmpTime) || 0;
+ this.coreWebMetrics.fmpTime = isNaN(FMP.fmpTime) ? -1 :
Math.floor(FMP.fmpTime);
}, 5000);
}
private CLS() {
if (!isLayoutShiftSupported()) {
- return this.coreWebMetrics.clsTime = 0;
+ return this.coreWebMetrics.clsTime = -1;
}
let partValue = 0;
let entryList: LayoutShift[] = [];
@@ -169,7 +169,7 @@ class TracePerf {
}
private LCP() {
if (!isLargestContentfulPaintSupported()) {
- return this.coreWebMetrics.lcpTime = 0;
+ return this.coreWebMetrics.lcpTime = -1;
}
prerenderChangeListener(() => {
const visibilityObserver = getVisibilityObserver();