Documentation
¶
Overview ¶
Package activity is the daemon's short operator-facing history: what happened to the model store and the runtimes, by whom (the mesh, the operator, or the daemon's own housekeeping), and why. A fixed-size ring in memory — the operator wants to see "the mesh started a 30 GB download at 14:02", not a durable audit log.
Index ¶
Constants ¶
const ( KindDownloadStarted = "download_started" KindDownloaded = "downloaded" KindDownloadFailed = "download_failed" KindLoaded = "loaded" KindUnloaded = "unloaded" KindEvicted = "evicted" KindDeclined = "declined" KindMissing = "missing" KindUpdateAvailable = "update_available" KindAssignment = "assignment" // KindResized: a loaded model was restarted with another slot count // (slots follow demand, or memory pressure took them back). KindResized = "resized" )
Kinds of activity (api/openapi.yaml ActivityEvent.kind).
const ( ActorMesh = "mesh" ActorOperator = "operator" ActorDaemon = "daemon" )
Actors: who caused the event.
const DefaultCapacity = 200
DefaultCapacity is how many events a Ring keeps.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Time time.Time `json:"time"`
Kind string `json:"kind"`
Actor string `json:"actor"`
Model string `json:"model,omitempty"`
Message string `json:"message"`
Detail string `json:"detail,omitempty"`
}
Event is one row of the feed.
type Ring ¶
type Ring struct {
// Events, when set, receives each event as an `activity` SSE event.
Events *events.Hub
// contains filtered or unexported fields
}
Ring keeps the last N events, newest first on read. Safe for concurrent use; a nil *Ring accepts and drops events so producers need no nil checks.