Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Metrics names.
	MetricNameBuildInfo = "doublezero_monitor_build_info"
	MetricNameErrors    = "doublezero_monitor_errors_total"

	// Labels.
	MetricLabelVersion   = "version"
	MetricLabelCommit    = "commit"
	MetricLabelDate      = "date"
	MetricLabelErrorType = "error_type"
)

Variables

View Source
var (
	MetricBuildInfo = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: MetricNameBuildInfo,
			Help: "Build information of the monitor agent",
		},
		[]string{MetricLabelVersion, MetricLabelCommit, MetricLabelDate},
	)

	MetricErrors = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: MetricNameErrors,
			Help: "Number of errors encountered",
		},
		[]string{MetricLabelErrorType},
	)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger          *slog.Logger
	LedgerRPCClient LedgerRPCClient
	Serviceability  ServiceabilityClient
	Telemetry       TelemetryProgramClient
	Interval        time.Duration
}

func (*Config) Validate

func (c *Config) Validate() error

type LedgerRPCClient

type LedgerRPCClient interface {
	GetEpochInfo(ctx context.Context, commitment solanarpc.CommitmentType) (*solanarpc.GetEpochInfoResult, error)
}

type ServiceabilityClient

type ServiceabilityClient interface {
	GetProgramData(context.Context) (*serviceability.ProgramData, error)
}

type TelemetryProgramClient

type TelemetryProgramClient interface {
	GetDeviceLatencySamples(ctx context.Context, originDevicePubKey, targetDevicePubKey, linkPubKey solana.PublicKey, epoch uint64) (*telemetry.DeviceLatencySamples, error)
}

type Watcher

type Watcher interface {
	Name() string
	Run(ctx context.Context) error
}

type Worker

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

func New

func New(cfg *Config) (*Worker, error)

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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