hoststat

package
v0.0.0-...-5f5e9cb Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Collection = "host_stats"

Collection stores host usage statistics as time series data.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostStat

type HostStat struct {
	ID        string    `bson:"_id"`
	Distro    string    `bson:"distro"`
	Timestamp time.Time `bson:"timestamp"`
	NumHosts  int       `bson:"num_hosts"`
}

HostStat records statistics about host usage by distro.

func Find

func Find(ctx context.Context, q db.Q) ([]HostStat, error)

Find finds all host stats that match the given query.

func FindByDistroSince

func FindByDistroSince(ctx context.Context, distroID string, startAt time.Time) ([]HostStat, error)

FindByDistroSince finds all host stats for a given distro since the start timestamp.

func NewHostStat

func NewHostStat(distroID string, numHosts int) *HostStat

func (*HostStat) Insert

func (hs *HostStat) Insert(ctx context.Context) error

Jump to

Keyboard shortcuts

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