feat: add muxer job queue with SQLite integration and metrics tracking

This commit is contained in:
MythEclipse
2026-05-13 17:06:22 +07:00
parent 978c2c468d
commit f9a4b4a92d
7 changed files with 321 additions and 1 deletions
+8
View File
@@ -6,6 +6,7 @@ import pinoHttp from "pino-http";
import prism from "prism-media";
import { WebSocketServer } from "ws";
import { createChildLogger, logger } from "./logger";
import { getMetrics, uptimeGauge } from "./metrics";
import { discordPlayer } from "./player";
const wsLogger = createChildLogger("webserver");
@@ -68,6 +69,13 @@ export function startWebserver(port: number = 3000) {
});
});
// Metrics endpoint
app.get("/metrics", async (_req, res) => {
res.set("Content-Type", "text/plain");
uptimeGauge.set(process.uptime());
res.send(await getMetrics());
});
// Inbound: Discord PCM → tagged chunks → browser
(global as any).broadcastPcmToWeb = (chunk: Buffer, userId: string) => {
let hash = 0;