metrics

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(addr string, logger *slog.Logger) (*http.Server, error)

Types

type MetricsSnapshot

type MetricsSnapshot struct {
	ByTool             []ToolMetric   `json:"by_tool"`
	ByServer           []ServerMetric `json:"by_server"`
	TotalSpend         int64          `json:"total_spend"`
	Top5ExpensiveTools []ToolMetric   `json:"top_5_expensive_tools"`
}

func Snapshot

func Snapshot() MetricsSnapshot

type PromptHashEntry

type PromptHashEntry struct {
	Hash      string `json:"hash"`
	TokenCost int64  `json:"token_cost"`
	Count     int64  `json:"count"`
}

type PromptHashResult

type PromptHashResult struct {
	Hashes []PromptHashEntry `json:"hashes"`
	Total  int64             `json:"total"`
}

func ServerToolPromptHashes

func ServerToolPromptHashes(serverName, toolName string) PromptHashResult

type ServerDrillDown

type ServerDrillDown struct {
	ServerName  string          `json:"server_name"`
	Tools       []ToolDrillDown `json:"tools"`
	TotalTokens int64           `json:"total_tokens"`
}

func ServerDrilldown

func ServerDrilldown(serverName string, since time.Time) ServerDrillDown

type ServerMetric

type ServerMetric struct {
	ServerName string `json:"server_name"`
	TokenCount int64  `json:"token_count"`
}

type ToolDrillDown

type ToolDrillDown struct {
	ToolName      string    `json:"tool_name"`
	CallCount     int64     `json:"call_count"`
	TokenCount    int64     `json:"token_count"`
	AvgTokensCall float64   `json:"avg_tokens_call"`
	LastInvoked   time.Time `json:"last_invoked"`
}

type ToolMetric

type ToolMetric struct {
	ToolName   string `json:"tool_name"`
	TokenCount int64  `json:"token_count"`
}

type ToolServerDrillDown

type ToolServerDrillDown struct {
	ToolName    string          `json:"tool_name"`
	Servers     []ToolDrillDown `json:"servers"`
	TotalTokens int64           `json:"total_tokens"`
}

func ToolDrilldown

func ToolDrilldown(toolName string, since time.Time) ToolServerDrillDown

Jump to

Keyboard shortcuts

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