perf: remove this cache calculation bullshit, uses too much CPU
This commit is contained in:
parent
7fa4083f35
commit
367d62134b
1 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Hono } from "hono";
|
||||
import { Counter, Gauge, Registry } from "prom-client";
|
||||
import { kv } from "../lib/helpers/youtubePlayerHandling.ts";
|
||||
import { Counter, Gauge, Registry, } from "prom-client";
|
||||
// import { kv } from "../lib/helpers/youtubePlayerHandling.ts";
|
||||
|
||||
const metrics = new Hono();
|
||||
const METRICS_PREFIX = "invidious_companion_";
|
||||
|
@ -35,12 +35,12 @@ export const successfulRequests = createCounter("successful_requests", "TODO");
|
|||
export const retryCount = createCounter("retry_count", "TODO");
|
||||
|
||||
metrics.get("/", async () => {
|
||||
let i = 0;
|
||||
const entries = kv.list({ prefix: ["video_cache"] });
|
||||
for await (const _ of entries) {
|
||||
i += 1;
|
||||
}
|
||||
cachedEntries.set(i);
|
||||
// let i = 0;
|
||||
// const entries = kv.list({ prefix: ["video_cache"] });
|
||||
// for await (const _ of entries) {
|
||||
// i += 1;
|
||||
// }
|
||||
// cachedEntries.set(i);
|
||||
return new Response(await register.metrics(), {
|
||||
headers: { "Content-Type": "text/plain" },
|
||||
});
|
||||
|
|
Reference in a new issue