Download src/gemini/guard/telemetry.ts from TTOPM/belel-protocol: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/gemini/guard/telemetry.ts
- Command line
-
hf download hf://TTOPM/belel-protocol/src/gemini/guard/telemetry.ts
-
curl -L -o telemetry.ts https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/gemini/guard/telemetry.ts
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`); | |
| } | |
| } | |
| } | |