mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
debug: re-enable Automod with extra profiling
This commit is contained in:
parent
2d012bc5cf
commit
53d7491c1b
8 changed files with 43 additions and 8 deletions
9
backend/src/utils/easyProfiler.ts
Normal file
9
backend/src/utils/easyProfiler.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { Profiler } from "knub/dist/Profiler";
|
||||
import { performance } from "perf_hooks";
|
||||
|
||||
export const startProfiling = (profiler: Profiler, key: string) => {
|
||||
const startTime = performance.now();
|
||||
return () => {
|
||||
profiler.addDataPoint(key, performance.now() - startTime);
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue