Adds perf metrics for each tRPC endpoint

This commit is contained in:
zomars committed 2022-06-27 19:19:33 -06:00
1 parent 2ba8f99302
commit 87befdbdf4
3 files changed
+14 -3

No files matched your search

+2 -1
View File
@@ -8,7 +8,8 @@ export const perfObserver =
globalThis.perfObserver ||
new PerformanceObserver((items) => {
items.getEntries().forEach((entry) => {
console.log(entry); // fake call to our custom logging solution
// Log entry duration in seconds with four decimal places.
console.log(entry.name.replace("$1", `${(entry.duration / 1000.0).toFixed(4)}s`));
});
});