Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIndexOutOfBounds = errors.New("db: graph index out of bounds")
ErrIndexOutOfBounds is returned by Select when the graph selector is outside the range of allocated graphs. Callers can match it with errors.Is.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB[K ~uint64, P float32 | float64] struct { Config *config.ConfigSet Graphs []graph.Graph[K, P] }
the db hols the logic of translating low level calls to the memory Graphs from and to the transaction object (that the server directly serialises to the client)
func (*DB[K, P]) NumGraphs ¶
NumGraphs reports how many graphs the store holds. Valid selectors are in [0, NumGraphs).
func (*DB[K, P]) Stats ¶
Stats snapshots every graph in selector order. Graphs not yet populated (before Start, or after Stop) contribute zero-valued entries, so the method is safe to call at any point in the store's lifecycle. Each live graph is read-locked for its snapshot, consistent with the scheduler holding the write lock during merges.
type GraphStats ¶
type GraphStats struct {
ID int `json:"id"`
graph.GraphStats
}
GraphStats is one graph's snapshot, tagged with its selector.
type Stats ¶
type Stats struct {
Graphs []GraphStats `json:"graphs"`
}
Stats is a point-in-time snapshot of the store: one entry per graph, in selector order. It is computed on demand from the live graphs (never cached) and serialised as-is by the server's stats endpoint.