Skip to content

Commit dfcef39

Browse files
committed
Always get the absolute value of the normalized measurement value
1 parent 10ac3e6 commit dfcef39

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/tracing/src/browser/metrics.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,10 @@ export class MetricsInstrumentation {
150150
const oldValue = this._measurements[name].value;
151151
const measurementTimestamp = timeOrigin + msToSec(oldValue);
152152
// normalizedValue should be in milliseconds
153-
const normalizedValue = (measurementTimestamp - transaction.startTimestamp) * 1000;
153+
const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);
154154

155155
const delta = normalizedValue - oldValue;
156-
logger.log(
157-
`[Measurements] Normalized ${name} from ${this._measurements[name].value} to ${normalizedValue} (${delta})`,
158-
);
156+
logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);
159157

160158
this._measurements[name].value = normalizedValue;
161159
});

0 commit comments

Comments
 (0)