Documentation
¶
Overview ¶
Package clusterresources samples whole-host CPU, memory, and storage for cloud's ephemeral cache, over the negotiated uplink session.
This is measured state with no entity behind it, so it rides a purpose-built capability rather than entity sync, at the cadence cloud asks for. It is the resource half of the legacy status report; when cloud selects this capability the poll has nothing left to say about resources.
Index ¶
Constants ¶
const ( Version1 uint = 1 TypeSample = "cluster.resources.sample" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
IntervalSeconds int `json:"interval_seconds"`
}
Config is how often cloud wants a sample once the session opens.
type Link ¶
type Link interface {
OfferCapability(uplink.CapabilityOffer)
OnSession(func(context.Context, uplink.Session))
SendMessageBlocking(context.Context, string, any) error
}
Link is the slice of the uplink client the reporter uses.
type Sample ¶
type Sample struct {
ObservedAt time.Time `json:"observed_at"`
CPUCores float64 `json:"cpu_cores,omitempty"`
CPUPercent float64 `json:"cpu_percent"`
MemoryBytes int64 `json:"memory_bytes,omitempty"`
MemoryPercent float64 `json:"memory_percent"`
StorageBytes int64 `json:"storage_bytes,omitempty"`
StoragePercent float64 `json:"storage_percent"`
}
Sample is one reading of what this host is spending. It is the resource half of the legacy status report, field for field. Percentages are whole-host utilization; the byte and core totals are capacity.