rediskeys

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rediskeys builds every Redis key this service uses, so one Redis can host several deployments behind REDIS_KEY_PREFIX.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keys

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

func New

func New(prefix string) Keys

func (Keys) BudgetKey

func (k Keys) BudgetKey(keyName, modelID, day string) string

BudgetKey is the daily token budget per client key and model (UTC day).

func (Keys) BudgetUser

func (k Keys) BudgetUser(userID, modelID, day string) string

BudgetUser is the daily token budget per end user and model (UTC day).

func (Keys) GCRAKey

func (k Keys) GCRAKey(keyName, modelID string) string

GCRAKey is the GCRA Theoretical Arrival Time key per client key and model.

func (Keys) GCRAUser

func (k Keys) GCRAUser(userID, modelID string) string

GCRAUser is the GCRA Theoretical Arrival Time key per end user and model.

func (Keys) KeyRPM added in v1.0.0

func (k Keys) KeyRPM(keyName string) string

KeyRPM and KeyTPM are the GCRA arrival times of a client key's own request and token rates, over all models.

func (Keys) KeyTPM added in v1.0.0

func (k Keys) KeyTPM(keyName string) string

func (Keys) NodeDrain

func (k Keys) NodeDrain(nodeID string) string

NodeDrain is set when an operator requests a graceful drain of the node.

func (Keys) NodeHeartbeat

func (k Keys) NodeHeartbeat(nodeID string) string

NodeHeartbeat holds the ephemeral heartbeat timestamp and dynamic telemetry.

func (Keys) NodeInflight

func (k Keys) NodeInflight(nodeID string) string

NodeInflight is the ZSET of active in-flight requests on the node.

func (Keys) NodeMeta

func (k Keys) NodeMeta(nodeID string) string

NodeMeta holds the static & semi-static registration data of a node.

func (Keys) NodePerf

func (k Keys) NodePerf(nodeID, modelID string) string

NodePerf holds EWMA metrics (tps_ema, ttft_ema_ms) for a specific node and model.

func (Keys) NodeUsage added in v1.3.0

func (k Keys) NodeUsage(nodeID string) string

NodeUsage is the stream of requests sent to the node, kept for its owner.

func (Keys) NodeUsageMark added in v1.3.0

func (k Keys) NodeUsageMark(nodeID string) string

NodeUsageMark holds when the node's usage log was last written; it outlives the log so a pull after the log expired can tell lost records from none.

func (Keys) NodesSet

func (k Keys) NodesSet() string

NodesSet is the SET of all known node IDs.

func (Keys) RPM

func (k Keys) RPM(keyName, modelID string, unixMinute int64) string

RPM is the fixed-window request counter per client key and model.

func (Keys) Spend

func (k Keys) Spend(subject, subjectID, window string) string

Spend is the nano-USD spend counter of one subject ("k" key, "u" user) in one UTC period window ("d20261015", "m202610"), shared across models.

func (Keys) ToolRPM added in v1.4.0

func (k Keys) ToolRPM(keyName, server, tool string) string

ToolRPM is the GCRA arrival time of a client key's calls to one MCP tool.

Jump to

Keyboard shortcuts

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