ServerRollupData
struct ServerRollupData : Content
An array of totals for various database entities. Each value in the array is essentially a SQL SELECT COUNT() FROM <table>,
although some values apply filters to the counted rows.
The CountType enum defines what each value in the counts array means, so counts[0] is a count of the Users in the database.
Used by: GET /api/v3/admin/rollup
-
An array with
CountType.allCases.countvalues.Declaration
Swift
var counts: [Int32] -
An int-valued enum that defines what each value in the counts array means. For API staibility it’s best if we only add values to the end of the list; causing existing elements to change threir index could cause confusion.
See moreDeclaration
Swift
enum CountType : Int, CaseIterable -
computeRollupCounts(on:Asynchronous) Runs the full set of table-count queries and returns a
ServerRollupData. Shared by the on-demandGET /api/v3/admin/rollupendpoint andTableCountsJob, which caches the results as Prometheus gauges on a timer so the counts don’t need to be recomputed on every metrics scrape.Declaration
Swift
static func computeRollupCounts(on db: Database) async throws -> ServerRollupData
View on GitHub