Spaces:
Sleeping
Sleeping
Download apps/api/src/controllers/v0/admin/index-queue-prometheus.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 798 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/controllers/v0/admin/index-queue-prometheus.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/controllers/v0/admin/index-queue-prometheus.ts
-
curl -L -o index-queue-prometheus.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/controllers/v0/admin/index-queue-prometheus.ts
798 Bytes
| import type { Request, Response } from "express"; | |
| import { | |
| getIndexInsertQueueLength, | |
| getOMCEQueueLength, | |
| } from "../../../services"; | |
| import { getWebhookInsertQueueLength } from "../../../services/webhook"; | |
| export async function indexQueuePrometheus(req: Request, res: Response) { | |
| const queueLength = await getIndexInsertQueueLength(); | |
| const webhookQueueLength = await getWebhookInsertQueueLength(); | |
| const omceQueueLength = await getOMCEQueueLength(); | |
| res.setHeader("Content-Type", "text/plain"); | |
| res.send(`\ | |
| # HELP firecrawl_index_queue_length The number of items in the index insert queue | |
| # TYPE firecrawl_index_queue_length gauge | |
| firecrawl_index_queue_length ${queueLength} | |
| firecrawl_webhook_queue_length ${webhookQueueLength} | |
| firecrawl_omce_queue_length ${omceQueueLength} | |
| `); | |
| } | |