Skip to content

Commit

Permalink
Fix performance logging showing negative numbers (#127)
Browse files Browse the repository at this point in the history
* use the correct performance.now()

* run prettier
  • Loading branch information
rorybainfreetrade authored Jan 7, 2022
1 parent be40a71 commit c2d2d4f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/driver/ChangeObserver/DatabaseChangeObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export abstract class DatabaseChangeObserver<T>
const duration = performance.now() - start
return {
path,
durationMillis: Math.abs(duration),
durationMillis: duration,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/driver/PubSub/InProcessFirebasePubSub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class InProcessFirebaseBuilderPubSub implements IFirebaseBuilderPubSub {
}).then(() =>
resolve({
topicName,
durationMillis: start - performance.now(),
durationMillis: performance.now() - start,
}),
)
},
Expand Down
2 changes: 1 addition & 1 deletion src/driver/RealtimeDatabase/InProcessRealtimeDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export class InProcessRealtimeDatabase implements IFirebaseRealtimeDatabase {
observer.onChange({ before, after, data, delta }).then(() =>
resolve({
path,
durationMillis: start - performance.now(),
durationMillis: performance.now() - start,
}),
)
},
Expand Down

0 comments on commit c2d2d4f

Please sign in to comment.