Adds perf metrics for each tRPC endpoint
This commit is contained in:
1 parent
2ba8f99302
commit
87befdbdf4
3 files changed
+14
-3
No files matched your search
@@ -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`));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user