arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Sql.Stats

Description

Internal to the arbiter packages. Not covered by the PVP.

Stats SQL templates.

Synopsis

Documentation

getQueueStatsSQL :: RowCodec a -> SchemaName -> TableName -> [Text] -> Query aSource #

Per-status queue counts plus the age of the oldest ready and in_flight job. The ready age covers ready and blocked rows and runs from when the row became visible. Counts follow the jobStatusCaseSQL taxonomy, with blocked rows split out of ready, and sum to total_jobs.

allQueueStatsSQL :: RowCodec a -> SchemaName -> [(TableName, [Text])] -> Query aSource #

Every queue's stats in one query, tagged by name. Caller guards the empty list.

countChildrenBatchSQL :: SchemaName -> TableName -> [Int64] -> Query ()Source #

Child counts as (parent_id, total, suspended) per parent, over a set of job ids. The caller attaches the row decoder.

listGroupsSQL :: RowCodec a -> SchemaName -> TableName -> Maybe Text -> Int64 -> Int64 -> Query aSource #

A page of a queue's open groups from the summary table, largest first, each with its head: the job that holds the group or that its next claim takes.

countGroupsSQL :: SchemaName -> TableName -> Maybe Text -> Query Int64Source #

The number of open groups listGroupsSQL pages through.