Copilot commented on code in PR #13597:
URL: https://github.com/apache/skywalking/pull/13597#discussion_r2579889823


##########
docs/en/api/browser-protocol.md:
##########
@@ -55,7 +55,7 @@ Input:
   "pagePath": "/index.html",
   "fmpTime": 10, // Deprecated since skywalking-client-js 1.0. This is no 
longer recommended. Please use the `useWebVitals` instead.
   /* NOTE, Safari does not support all core web vitals, and Firefox does not 
support `CLS`. */
-  "clsTime": 10,
+  "clsTime": 0.1,

Review Comment:
   The field name in the documentation is still `clsTime` but should be updated 
to `cls` to match the code changes.
   ```suggestion
     "cls": 0.1,
   ```



##########
oap-server/server-receiver-plugin/skywalking-browser-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/browser/provider/parser/performance/listener/BrowserWebVitalsPerfDataAnalysisListener.java:
##########
@@ -49,7 +49,9 @@ public void parse(BrowserWebVitalsPerfDataDecorator 
decorator) {
         
browserAppWebVitalsPerf.setServiceName(namingControl.formatServiceName(decorator.getService()));
         
browserAppWebVitalsPerf.setPath(namingControl.formatEndpointName(browserAppWebVitalsPerf.getServiceName(),
 decorator.getPagePath()));
         browserAppWebVitalsPerf.setFmpTime(decorator.getFmpTime());
-        browserAppWebVitalsPerf.setClsTime(decorator.getClsTime());
+        // Make CLS multiply 1000 to convert to int from double
+        // MQE should divide it by 1000 while querying

Review Comment:
   The comment should clarify why the conversion is necessary (e.g., 'CLS 
values are typically between 0 and 1, multiplying by 1000 allows storage as an 
integer while preserving precision') and mention the precision being preserved 
(3 decimal places).
   ```suggestion
           // CLS values are typically between 0 and 1. Multiplying by 1000 
allows storage as an integer
           // while preserving 3 decimal places of precision. When querying, 
divide by 1000 to restore the original value.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to