Skip to content

Commit

Permalink
Merge pull request #2199 from SalesforceCommerceCloud/bendvc/fix-sdk-…
Browse files Browse the repository at this point in the history
…performance-util

[SDK] Fix `Performance` util class
  • Loading branch information
bendvc authored Jan 13, 2025
2 parents 3ebf7c7 + 44b778d commit b9a3212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/pwa-kit-react-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## v3.9.0-dev (Oct 29, 2024)
- Fix the performance logging util to not round duration. [#2199](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2199)
- Add RedirectWithStatus component, allowing finer grained control of rediriects and their status code [#2173](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2173)

## v3.8.0 (Oct 28, 2024)
Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-react-sdk/src/utils/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class PerformanceTimer {
buildServerTimingHeader() {
const header = this.metrics
.map((metric) => {
return `${metric.name};dur=${metric.duration}`
return `${metric.name};dur=${metric.duration.toFixed(2)}`
})
.join(', ')

Expand Down Expand Up @@ -117,7 +117,7 @@ export default class PerformanceTimer {
if (startMark) {
const measurement = {
name,
duration: (timestamp - startMark.timestamp).toFixed(2),
duration: timestamp - startMark.timestamp,
detail: options.detail
}
this.metrics.push(measurement)
Expand Down

0 comments on commit b9a3212

Please sign in to comment.