import type { Doc, Id } from "./_generated/dataModel.js"; import { type MutationCtx } from "./_generated/server.js"; import { type Config } from "./shared.js"; import { type Logger } from "./logging.js"; /** * Record stats about work execution. Intended to be queried by Axiom or Datadog. * See the [README](https://github.com/get-convex/workpool) for example queries. */ export declare function recordEnqueued(console: Logger, data: { workId: Id<"work">; fnName: string; runAt: number; }): void; export declare function recordStarted(console: Logger, work: Doc<"work">, lagMs: number): void; export declare function recordCompleted(console: Logger, work: Doc<"work">, status: "success" | "failed" | "canceled" | "retrying"): void; export declare function generateReport(ctx: MutationCtx, console: Logger, state: Doc<"internalState">, { maxParallelism, logLevel }: Config): Promise; export declare const calculateBacklogAndReport: import("convex/server").RegisteredMutation<"internal", { logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR"; running: number; report: { failed: number; canceled: number; completed: number; succeeded: number; retries: number; lastReportTs: number; }; cursor: string; startSegment: bigint; endSegment: bigint; }, Promise>; /** * Warning: this should not be used from a mutation, as it will cause conflicts. * Use this while developing to see the state of the queue. */ export declare const diagnostics: import("convex/server").RegisteredQuery<"internal", {}, Promise<{ canceling: any; waiting: any; running: number; completing: any; spareCapacity: number; runStatus: "running" | "scheduled" | "idle" | undefined; generation: bigint | undefined; }>>; //# sourceMappingURL=stats.d.ts.map