engine/

directory
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0

Directories

Path Synopsis
Package adjustments resolves the pricing adjustments a project's relations carry and applies them to the rated amounts of its statement.
Package adjustments resolves the pricing adjustments a project's relations carry and applies them to the rated amounts of its statement.
Package attribution resolves who pays for whose usage: one breadth-first walk over the attributing relations of a billing period, started from every project no relation attributes away.
Package attribution resolves who pays for whose usage: one breadth-first walk over the attributing relations of a billing period, started from every project no relation attributes away.
Package config parses the metering engine's environment configuration.
Package config parses the metering engine's environment configuration.
Package corrections is the arithmetic and the rendering of a correction run: the amounts one metering and rating pass produced per key, the differences between two such passes, and the credit note every affected project is handed for them.
Package corrections is the arithmetic and the rendering of a correction run: the amounts one metering and rating pass produced per key, the differences between two such passes, and the credit note every affected project is handed for them.
Package counters measures the counter metrics of a deployment per usage draft, from the counter sources file the deployment configures.
Package counters measures the counter metrics of a deployment per usage draft, from the counter sources file the deployment configures.
Package export reads one run back out of the engine database and hands it to a BillingExporter, which is the seam every consumer of billing artifacts sits behind.
Package export reads one run back out of the engine database and hands it to a BillingExporter, which is the seam every consumer of billing artifacts sits behind.
Package invariants holds the usage drafts metering derives for one resource and one billing period to the four checks they must pass before anything is persisted: no gaps or overlaps, coverage, traceability, and an implicit count of one.
Package invariants holds the usage drafts metering derives for one resource and one billing period to the four checks they must pass before anything is persisted: no gaps or overlaps, coverage, traceability, and an implicit count of one.
Package metering folds each candidate resource's event history into the usage drafts of one billing period: the intervals the fold implies, clipped to the period, carrying the quantities every later number is derived from.
Package metering folds each candidate resource's event history into the usage drafts of one billing period: the intervals the fold implies, clipped to the period, carrying the quantities every later number is derived from.
Package period turns the YYYY-MM billing month the engine CLI reads and prints into the interval a run meters over.
Package period turns the YYYY-MM billing month the engine CLI reads and prints into the interval a run meters over.
Package pricing reads a pricing model: the versioned document that says what a unit of every priced metric costs, per platform and resource type.
Package pricing reads a pricing model: the versioned document that says what a unit of every priced metric costs, per platform and resource type.
Package rating turns the usage drafts of a billing period into amounts: one per draft and dimension of the pricing entry its resource type carries.
Package rating turns the usage drafts of a billing period into amounts: one per draft and dimension of the pricing entry its resource type carries.
Package runs executes one billing period: it takes the period lock, opens a run row, chains metering, counters, rating, attribution and statement rendering over one reporting snapshot, and writes what came out under that run.
Package runs executes one billing period: it takes the period lock, opens a run row, chains metering, counters, rating, attribution and statement rendering over one reporting snapshot, and writes what came out under that run.
Package scheduler is the hourly tick of the engine: it walks the billing months that have ended, moves each of them from open into grace, and has the month whose grace window has passed metered and, where the deployment asks for it, closed.
Package scheduler is the hourly tick of the engine: it walks the billing months that have ended, moves each of them from open into grace, and has the month whose grace window has passed metered and, where the deployment asks for it, closed.
Package source is the metering engine's read seam over the Reporting database: a connection pool and, per run, one read-only REPEATABLE READ transaction that every read of that run goes through (D1, D3).
Package source is the metering engine's read seam over the Reporting database: a connection pool and, per run, one read-only REPEATABLE READ transaction that every read of that run goes through (D1, D3).
Package statements renders what a billing period is invoiced from: one statement document per top-level project, in the format the concept fixes (docs/explanation/worked-examples.md), holding a line item per resource, a period per usage draft, and the costs of every project attributed to that one beside its own.
Package statements renders what a billing period is invoiced from: one statement document per top-level project, in the format the concept fixes (docs/explanation/worked-examples.md), holding a line item per resource, a period per usage draft, and the costs of every project attributed to that one beside its own.
Package store is the metering engine's database seam: the pgx connection pool and the migrator that applies the embedded engine chain.
Package store is the metering engine's database seam: the pgx connection pool and the migrator that applies the embedded engine chain.
storetest
Package storetest hands integration tests a plain PostgreSQL 16 container with the engine migration chain applied.
Package storetest hands integration tests a plain PostgreSQL 16 container with the engine migration chain applied.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL