Spaces:
Configuration error
Configuration error
Download src/monitoring/analytics.js from UUUZCX/video-optimizer-bot: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/monitoring/analytics.js
- Command line
-
hf download hf://spaces/UUUZCX/video-optimizer-bot/src/monitoring/analytics.js
-
curl -L -o analytics.js https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/monitoring/analytics.js
461 Bytes
| const { getDb } = require("../config/db"); | |
| const { nowIso } = require("../utils/time"); | |
| function metric(jobId, name, value, unit = null) { | |
| getDb().prepare("INSERT INTO metrics (job_id, name, value, unit, created_at) VALUES (?, ?, ?, ?, ?)") | |
| .run(jobId, name, value, unit, nowIso()); | |
| } | |
| function listMetrics(limit = 200) { | |
| return getDb().prepare("SELECT * FROM metrics ORDER BY id DESC LIMIT ?").all(limit); | |
| } | |
| module.exports = { metric, listMetrics }; | |