belel-protocol / src /gemini /guard /telemetry.ts
TTOPM's picture
Upload 28 files
f1bfa1e verified
Raw History Blame Contribute Delete
318 Bytes
import cfg from "../config/gemini.config.json";
export async function withTrace<T>(name: string, fn: () => Promise<T>) {
const start = Date.now();
try { return await fn(); }
finally {
if (cfg.telemetry.enabled) {
const ms = Date.now() - start;
console.log(`[TRACE] ${name} ${ms}ms`);
}
}
}