Documentation ¶
Index ¶
- Variables
- func AddConfigOverride[Cfg cell.Flagger](h *Hive, override func(*Cfg))
- func NewStateDBMetricsImpl(m StateDBMetrics) statedb.Metrics
- func NewStateDBReconcilerMetricsImpl(m ReconcilerMetrics) reconciler.Metrics
- type Hive
- type OnDemand
- type Options
- type ReconcilerMetrics
- type Shutdowner
- type StateDBMetrics
Constants ¶
This section is empty.
Variables ¶
var (
ShutdownWithError = upstream.ShutdownWithError
)
Functions ¶
func AddConfigOverride ¶
func NewStateDBMetricsImpl ¶
func NewStateDBMetricsImpl(m StateDBMetrics) statedb.Metrics
func NewStateDBReconcilerMetricsImpl ¶
func NewStateDBReconcilerMetricsImpl(m ReconcilerMetrics) reconciler.Metrics
Types ¶
type OnDemand ¶
type OnDemand[Resource any] interface { // Acquire a resource. On the first call to Acquire() the underlying // resource is started with the provided context that aborts the start // if the context is cancelled. On failure to start the resulting error // is returned. Acquire(context.Context) (Resource, error) // Release a resource. When the last acquired reference to the resource // is released the resource is stopped. If stopping the resource fails // the error is returned. Release(resource Resource) error }
OnDemand provides access to a resource on-demand. On first call to Acquire() the resource is started (cell.Lifecycle.Start). If the starting of the resource fails Acquire() returns the error from Start(). When all references are Release()'d the resource is stopped (cell.Lifecycle.Stop), and again failure from Stop() is returned.
func NewOnDemand ¶
func NewOnDemand[Resource any](log *slog.Logger, resource Resource, hook cell.HookInterface) OnDemand[Resource]
NewOnDemand wraps a resource that will be started and stopped on-demand. The resource and the lifecycle hooks are provided separately, but can of course be the same thing. They're separate to support the use-case where the resource is a state object (e.g. StateDB table) and the hook is a job group that populates the object.
func NewStaticOnDemand ¶
NewStaticOnDemand creates an on-demand resource that is "static", i.e. always running and not started or stopped.
type ReconcilerMetrics ¶ added in v1.16.0
type ReconcilerMetrics struct { ReconciliationCount metric.Vec[metric.Counter] ReconciliationDuration metric.Vec[metric.Observer] ReconciliationTotalErrors metric.Vec[metric.Counter] ReconciliationCurrentErrors metric.Vec[metric.Gauge] PruneCount metric.Vec[metric.Counter] PruneTotalErrors metric.Vec[metric.Counter] PruneDuration metric.Vec[metric.Observer] }
func NewStateDBReconcilerMetrics ¶ added in v1.16.0
func NewStateDBReconcilerMetrics() ReconcilerMetrics
type Shutdowner ¶
type Shutdowner = upstream.Shutdowner
type StateDBMetrics ¶ added in v1.16.0
type StateDBMetrics struct { // How long a read transaction was held. WriteTxnDuration metric.Vec[metric.Observer] // How long it took to acquire a write transaction for all tables. WriteTxnAcquisition metric.Vec[metric.Observer] // How long writers were blocked while waiting to acquire a write transaction for a specific table. TableContention metric.Vec[metric.Gauge] // The amount of objects in a given table. TableObjectCount metric.Vec[metric.Gauge] // The current revision of a given table. TableRevision metric.Vec[metric.Gauge] // The amount of delete trackers for a given table. TableDeleteTrackerCount metric.Vec[metric.Gauge] // The amount of objects in the graveyard for a given table. TableGraveyardObjectCount metric.Vec[metric.Gauge] // The lowest revision of a given table that has been processed by the graveyard garbage collector. TableGraveyardLowWatermark metric.Vec[metric.Gauge] // The time it took to clean the graveyard for a given table. TableGraveyardCleaningDuration metric.Vec[metric.Observer] }
func NewStateDBMetrics ¶ added in v1.16.0
func NewStateDBMetrics() StateDBMetrics