adding monkeytype
Some checks failed
Mark Stale PRs / stale (push) Has been cancelled

This commit is contained in:
Benjamin Falch
2026-04-23 13:53:44 +02:00
parent e214a2fd35
commit 2bc741fb78
1930 changed files with 7590652 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { CronJob } from "cron";
import * as db from "../init/db";
import * as Prometheus from "../utils/prometheus";
const CRON_SCHEDULE = "0 */5 * * * *";
const collectionsToLog = [
"ape-keys",
"configs",
"errors",
"logs",
"presets",
"reports",
"results",
"users",
];
async function main(): Promise<void> {
await Promise.all(collectionsToLog.map(set));
}
async function set(collection: string): Promise<void> {
const size = await db.collection(collection).estimatedDocumentCount();
Prometheus.setCollectionSize(collection, size);
}
export default new CronJob(CRON_SCHEDULE, main);