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 f08776d fix: rename clsTime to cls and fix inp value (#168)
f08776d is described below
commit f08776d909eb1d9bc79c600e493030651b97e491
Author: Fine0830 <[email protected]>
AuthorDate: Tue Dec 2 20:29:00 2025 +0800
fix: rename clsTime to cls and fix inp value (#168)
---
src/performance/index.ts | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/performance/index.ts b/src/performance/index.ts
index 0901bd8..e52e1ff 100644
--- a/src/performance/index.ts
+++ b/src/performance/index.ts
@@ -40,7 +40,7 @@ const handler = {
collector: undefined,
useWebVitals: undefined,
};
- if (target.useWebVitals && !isNaN(Number(target.fmpTime)) &&
!isNaN(Number(target.lcpTime)) && !isNaN(Number(target.clsTime))) {
+ if (target.useWebVitals && !isNaN(Number(target.fmpTime)) &&
!isNaN(Number(target.lcpTime)) && !isNaN(Number(target.cls))) {
new TracePerf().reportPerf(source, String(target.collector));
}
return true;
@@ -127,7 +127,7 @@ class TracePerf {
}
private CLS() {
if (!isLayoutShiftSupported()) {
- return this.coreWebMetrics.clsTime = -1;
+ return this.coreWebMetrics.cls = -1;
}
let partValue = 0;
let entryList: LayoutShift[] = [];
@@ -152,7 +152,7 @@ class TracePerf {
});
if (partValue > 0) {
setTimeout(() => {
- this.coreWebMetrics.clsTime = partValue;
+ this.coreWebMetrics.cls = partValue;
}, 3000);
}
};
@@ -210,9 +210,9 @@ class TracePerf {
const interaction = getLongestInteraction();
const len = this.inpList.length;
- if (interaction && (!len || this.inpList[len - 1].inpTime !==
interaction.latency)) {
+ if (interaction && (!len || this.inpList[len - 1].inpTime !==
Math.floor(interaction.latency))) {
const param = {
- inpTime: interaction.latency,
+ inpTime: Math.floor(interaction.latency),
...this.perfInfo,
};
this.inpList.push(param);