Skip to content

Commit b9a3212

Browse files
authored
Merge pull request #2199 from SalesforceCommerceCloud/bendvc/fix-sdk-performance-util
[SDK] Fix `Performance` util class
2 parents 3ebf7c7 + 44b778d commit b9a3212

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/pwa-kit-react-sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## v3.9.0-dev (Oct 29, 2024)
2+
- Fix the performance logging util to not round duration. [#2199](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2199)
23
- Add RedirectWithStatus component, allowing finer grained control of rediriects and their status code [#2173](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2173)
34

45
## v3.8.0 (Oct 28, 2024)

packages/pwa-kit-react-sdk/src/utils/performance.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class PerformanceTimer {
5353
buildServerTimingHeader() {
5454
const header = this.metrics
5555
.map((metric) => {
56-
return `${metric.name};dur=${metric.duration}`
56+
return `${metric.name};dur=${metric.duration.toFixed(2)}`
5757
})
5858
.join(', ')
5959

@@ -117,7 +117,7 @@ export default class PerformanceTimer {
117117
if (startMark) {
118118
const measurement = {
119119
name,
120-
duration: (timestamp - startMark.timestamp).toFixed(2),
120+
duration: timestamp - startMark.timestamp,
121121
detail: options.detail
122122
}
123123
this.metrics.push(measurement)

0 commit comments

Comments
 (0)