Documentation
¶
Index ¶
- type DBTX
- type DegradedAlert
- type DeleteHeartbeatParams
- type DeleteHeartbeatsBeforeParams
- type DeleteMinutesOfSeriesBeforeParams
- type DeleteRollupsOfSeriesBeforeParams
- type DeleteStreamHeartbeatsUpToParams
- type GetSeriesParams
- type GetStreamPositionParams
- type Heartbeat
- type InsertDegradedAlertParams
- type InsertHeartbeatParams
- type InsertLatencyMinuteParams
- type InsertMetaParams
- type InsertSeriesParams
- type LastSeqParams
- type LatestHeartbeatsParams
- type ListHeartbeatsParams
- type ListOldestStreamSeqsParams
- type ListRollupsBatchParams
- type ListRollupsBatchRow
- type ListRollupsParams
- type ListRollupsRow
- type ListSeriesIDsAfterParams
- type ListSeriesIDsOfTenantAfterParams
- type ListStreamHeartbeatsAfterParams
- type ListStreamSeqsAfterParams
- type ListStreamSeqsOlderThanParams
- type Meta
- type MinSeqParams
- type Minute
- type PurgeDegradedAlertsOfTenantParams
- type PurgeHeartbeatsOfTenantParams
- type PurgeMinutesOfSeriesParams
- type PurgeRollupsOfSeriesParams
- type PurgeSeriesOfTenantParams
- type PurgedTenant
- type Queries
- func (q *Queries) DeleteHeartbeat(ctx context.Context, arg DeleteHeartbeatParams) error
- func (q *Queries) DeleteHeartbeatsBefore(ctx context.Context, arg DeleteHeartbeatsBeforeParams) (int64, error)
- func (q *Queries) DeleteMinutesOfSeriesBefore(ctx context.Context, arg DeleteMinutesOfSeriesBeforeParams) (int64, error)
- func (q *Queries) DeleteRollupsOfSeriesBefore(ctx context.Context, arg DeleteRollupsOfSeriesBeforeParams) (int64, error)
- func (q *Queries) DeleteStreamHeartbeatsUpTo(ctx context.Context, arg DeleteStreamHeartbeatsUpToParams) (int64, error)
- func (q *Queries) GetMeta(ctx context.Context, key string) (string, error)
- func (q *Queries) GetSeries(ctx context.Context, arg GetSeriesParams) (int64, error)
- func (q *Queries) GetStreamPosition(ctx context.Context, arg GetStreamPositionParams) (int64, error)
- func (q *Queries) InsertDegradedAlert(ctx context.Context, arg InsertDegradedAlertParams) (int64, error)
- func (q *Queries) InsertHeartbeat(ctx context.Context, arg InsertHeartbeatParams) (int64, error)
- func (q *Queries) InsertLatencyMinute(ctx context.Context, arg InsertLatencyMinuteParams) error
- func (q *Queries) InsertMeta(ctx context.Context, arg InsertMetaParams) error
- func (q *Queries) InsertSeries(ctx context.Context, arg InsertSeriesParams) (int64, error)
- func (q *Queries) LastSeq(ctx context.Context, arg LastSeqParams) (int64, error)
- func (q *Queries) LatestHeartbeats(ctx context.Context, arg LatestHeartbeatsParams) ([]Heartbeat, error)
- func (q *Queries) ListHeartbeats(ctx context.Context, arg ListHeartbeatsParams) ([]Heartbeat, error)
- func (q *Queries) ListOldestStreamSeqs(ctx context.Context, arg ListOldestStreamSeqsParams) ([]int64, error)
- func (q *Queries) ListPurgedTenants(ctx context.Context) ([]string, error)
- func (q *Queries) ListRollups(ctx context.Context, arg ListRollupsParams) ([]ListRollupsRow, error)
- func (q *Queries) ListRollupsBatch(ctx context.Context, arg ListRollupsBatchParams) ([]ListRollupsBatchRow, error)
- func (q *Queries) ListSeriesIDsAfter(ctx context.Context, arg ListSeriesIDsAfterParams) ([]int64, error)
- func (q *Queries) ListSeriesIDsOfTenantAfter(ctx context.Context, arg ListSeriesIDsOfTenantAfterParams) ([]int64, error)
- func (q *Queries) ListStreamHeartbeatsAfter(ctx context.Context, arg ListStreamHeartbeatsAfterParams) ([]Heartbeat, error)
- func (q *Queries) ListStreamPositions(ctx context.Context) ([]StreamPosition, error)
- func (q *Queries) ListStreamSeqsAfter(ctx context.Context, arg ListStreamSeqsAfterParams) ([]int64, error)
- func (q *Queries) ListStreamSeqsOlderThan(ctx context.Context, arg ListStreamSeqsOlderThanParams) ([]int64, error)
- func (q *Queries) ListUnreportedDegradedAlerts(ctx context.Context, rowLimit int64) ([]DegradedAlert, error)
- func (q *Queries) MarkDegradedAlertReported(ctx context.Context, id int64) error
- func (q *Queries) MinSeq(ctx context.Context, arg MinSeqParams) (int64, error)
- func (q *Queries) PruneDegradedAlerts(ctx context.Context, sentMs int64) (int64, error)
- func (q *Queries) PurgeDegradedAlertsOfTenant(ctx context.Context, arg PurgeDegradedAlertsOfTenantParams) (int64, error)
- func (q *Queries) PurgeHeartbeatsOfTenant(ctx context.Context, arg PurgeHeartbeatsOfTenantParams) (int64, error)
- func (q *Queries) PurgeMinutesOfSeries(ctx context.Context, arg PurgeMinutesOfSeriesParams) (int64, error)
- func (q *Queries) PurgeRollupsOfSeries(ctx context.Context, arg PurgeRollupsOfSeriesParams) (int64, error)
- func (q *Queries) PurgeSeriesOfTenant(ctx context.Context, arg PurgeSeriesOfTenantParams) (int64, error)
- func (q *Queries) UnackedStats(ctx context.Context, arg UnackedStatsParams) (UnackedStatsRow, error)
- func (q *Queries) UpsertMeta(ctx context.Context, arg UpsertMetaParams) error
- func (q *Queries) UpsertPurgedTenant(ctx context.Context, arg UpsertPurgedTenantParams) error
- func (q *Queries) UpsertRollup(ctx context.Context, arg UpsertRollupParams) error
- func (q *Queries) UpsertStreamPosition(ctx context.Context, arg UpsertStreamPositionParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Rollup
- type Series
- type StreamPosition
- type UnackedStatsParams
- type UnackedStatsRow
- type UpsertMetaParams
- type UpsertPurgedTenantParams
- type UpsertRollupParams
- type UpsertStreamPositionParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DegradedAlert ¶
type DeleteHeartbeatParams ¶
type DeleteStreamHeartbeatsUpToParams ¶ added in v0.0.4
type GetSeriesParams ¶
type GetStreamPositionParams ¶
type InsertHeartbeatParams ¶
type InsertMetaParams ¶
type InsertSeriesParams ¶
type LastSeqParams ¶
type LatestHeartbeatsParams ¶
type ListHeartbeatsParams ¶
type ListOldestStreamSeqsParams ¶ added in v0.0.4
type ListRollupsBatchParams ¶
type ListRollupsBatchRow ¶
type ListRollupsParams ¶
type ListRollupsRow ¶
type ListStreamSeqsOlderThanParams ¶ added in v0.0.4
type MinSeqParams ¶ added in v0.0.4
type PurgedTenant ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteHeartbeat ¶
func (q *Queries) DeleteHeartbeat(ctx context.Context, arg DeleteHeartbeatParams) error
func (*Queries) DeleteHeartbeatsBefore ¶
func (q *Queries) DeleteHeartbeatsBefore(ctx context.Context, arg DeleteHeartbeatsBeforeParams) (int64, error)
One retention batch; short write transactions keep the writer responsive (FA-UPT-06).
func (*Queries) DeleteMinutesOfSeriesBefore ¶
func (q *Queries) DeleteMinutesOfSeriesBefore(ctx context.Context, arg DeleteMinutesOfSeriesBeforeParams) (int64, error)
One series: the primary key prefix series_id drives the subquery and the delete.
func (*Queries) DeleteRollupsOfSeriesBefore ¶
func (q *Queries) DeleteRollupsOfSeriesBefore(ctx context.Context, arg DeleteRollupsOfSeriesBeforeParams) (int64, error)
One series, one bucket size: the primary key prefix (series_id, bucket_ms) drives both the subquery and the delete, so no statement scans the table. The subquery bounds the batch to row_limit rows.
func (*Queries) DeleteStreamHeartbeatsUpTo ¶ added in v0.0.4
func (*Queries) GetSeries ¶
Series are resolved with the tenant: a monitor and node of another tenant never match (ADR 0016).
func (*Queries) GetStreamPosition ¶
func (*Queries) InsertDegradedAlert ¶
func (*Queries) InsertHeartbeat ¶
func (*Queries) InsertLatencyMinute ¶
func (q *Queries) InsertLatencyMinute(ctx context.Context, arg InsertLatencyMinuteParams) error
Latencies are microseconds. Existing minutes are kept (FA-UPT-04).
func (*Queries) InsertMeta ¶
func (q *Queries) InsertMeta(ctx context.Context, arg InsertMetaParams) error
func (*Queries) InsertSeries ¶
func (*Queries) LatestHeartbeats ¶
func (q *Queries) LatestHeartbeats(ctx context.Context, arg LatestHeartbeatsParams) ([]Heartbeat, error)
Newest heartbeats of a monitor, optionally of one node.
func (*Queries) ListHeartbeats ¶
func (q *Queries) ListHeartbeats(ctx context.Context, arg ListHeartbeatsParams) ([]Heartbeat, error)
Keyset pagination ordered by (ts_ms, node_id, incarnation, seq).
func (*Queries) ListOldestStreamSeqs ¶ added in v0.0.4
func (*Queries) ListPurgedTenants ¶
func (*Queries) ListRollups ¶
func (q *Queries) ListRollups(ctx context.Context, arg ListRollupsParams) ([]ListRollupsRow, error)
Joins series and filters by tenant in SQL: the tenant boundary never depends on the series cache (ADR 0016, FA-TEN-01).
func (*Queries) ListRollupsBatch ¶
func (q *Queries) ListRollupsBatch(ctx context.Context, arg ListRollupsBatchParams) ([]ListRollupsBatchRow, error)
Rollups of several monitors of one node (node_id ” is the consensus) and bucket size. Joins series and filters by tenant in SQL (ADR 0016).
func (*Queries) ListSeriesIDsAfter ¶
func (q *Queries) ListSeriesIDsAfter(ctx context.Context, arg ListSeriesIDsAfterParams) ([]int64, error)
Pages through the series in ID order for the per-series retention batches.
func (*Queries) ListSeriesIDsOfTenantAfter ¶
func (q *Queries) ListSeriesIDsOfTenantAfter(ctx context.Context, arg ListSeriesIDsOfTenantAfterParams) ([]int64, error)
Pages through the series of one tenant in ID order.
func (*Queries) ListStreamHeartbeatsAfter ¶
func (q *Queries) ListStreamHeartbeatsAfter(ctx context.Context, arg ListStreamHeartbeatsAfterParams) ([]Heartbeat, error)
One stream in seq order, afterSeq < seq <= untilSeq.
func (*Queries) ListStreamPositions ¶
func (q *Queries) ListStreamPositions(ctx context.Context) ([]StreamPosition, error)
func (*Queries) ListStreamSeqsAfter ¶
func (q *Queries) ListStreamSeqsAfter(ctx context.Context, arg ListStreamSeqsAfterParams) ([]int64, error)
Seqs only, to find the contiguous run above a position; the heartbeats primary key serves the range.
func (*Queries) ListStreamSeqsOlderThan ¶ added in v0.0.4
func (*Queries) ListUnreportedDegradedAlerts ¶
func (*Queries) MarkDegradedAlertReported ¶
func (*Queries) PruneDegradedAlerts ¶
func (*Queries) PurgeDegradedAlertsOfTenant ¶
func (*Queries) PurgeHeartbeatsOfTenant ¶
func (q *Queries) PurgeHeartbeatsOfTenant(ctx context.Context, arg PurgeHeartbeatsOfTenantParams) (int64, error)
One purge batch of a tenant (ADR 0029); the tenant has no index here, so each batch scans heartbeats until it has found row_limit rows of the tenant.
func (*Queries) PurgeMinutesOfSeries ¶
func (q *Queries) PurgeMinutesOfSeries(ctx context.Context, arg PurgeMinutesOfSeriesParams) (int64, error)
One series: the primary key prefix series_id drives the subquery and the delete.
func (*Queries) PurgeRollupsOfSeries ¶
func (q *Queries) PurgeRollupsOfSeries(ctx context.Context, arg PurgeRollupsOfSeriesParams) (int64, error)
One series: the primary key prefix series_id drives the subquery and the delete.
func (*Queries) PurgeSeriesOfTenant ¶
func (q *Queries) PurgeSeriesOfTenant(ctx context.Context, arg PurgeSeriesOfTenantParams) (int64, error)
Removes series only once no rollup or latency minute references them.
func (*Queries) UnackedStats ¶ added in v0.0.4
func (q *Queries) UnackedStats(ctx context.Context, arg UnackedStatsParams) (UnackedStatsRow, error)
func (*Queries) UpsertMeta ¶
func (q *Queries) UpsertMeta(ctx context.Context, arg UpsertMetaParams) error
func (*Queries) UpsertPurgedTenant ¶
func (q *Queries) UpsertPurgedTenant(ctx context.Context, arg UpsertPurgedTenantParams) error
func (*Queries) UpsertRollup ¶
func (q *Queries) UpsertRollup(ctx context.Context, arg UpsertRollupParams) error
Values are written by series ID; the caller resolves it inside the write transaction (ADR 0016). Latencies are microseconds.
func (*Queries) UpsertStreamPosition ¶
func (q *Queries) UpsertStreamPosition(ctx context.Context, arg UpsertStreamPositionParams) error
Positions never move backwards: a lower seq leaves the stored one.