coremetricspg

package
v0.0.13-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package coremetricspg reads the Core metrics that PostgreSQL holds: the deployment's root Turn queue and its history, and the database size.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store reads Core metrics from Core's database.

func New

func New(units *pgunit.Pool) *Store

New builds the Core metrics reader on units.

func (*Store) ReadDatabaseSize

func (s *Store) ReadDatabaseSize(ctx context.Context) (int64, error)

ReadDatabaseSize measures the current PostgreSQL database in bytes.

func (*Store) ReadExecutionHistory

func (s *Store) ReadExecutionHistory(ctx context.Context, start, end time.Time, resolution time.Duration) (coremetrics.History, error)

ReadExecutionHistory reads a bounded, repeatable read-only snapshot of root Turn history. The interval is [start,end), with complete epoch-aligned buckets keyed by their UTC start. Interruptions use failed Turns' completed_at and execution_interrupted error code. Queue waits use started_at-created_at in milliseconds, grouped by started_at, including retained history of deleted Sessions. Counts of an empty interval are zero; percentile values without observations are nil. Read errors invalidate the entire result and must not be presented as measured zeros.

func (*Store) ReadExecutionSnapshot

func (s *Store) ReadExecutionSnapshot(ctx context.Context, now time.Time, connectedDeviceIDs []string) (coremetrics.ExecutionSnapshot, error)

ReadExecutionSnapshot counts persisted root Turns across the deployment. WaitingForDaemon is the queued subset whose Session binding is absent from the supplied live registry IDs; callers must distinguish an unavailable registry from an observed empty one before using this method. Age is in seconds, and is nil when the queue is empty. No Session deletion filter hides operational state.

Jump to

Keyboard shortcuts

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