reporter

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrackCost

func TrackCost(toolName, serverName string, tokenCount int64)

func TrackCostFromStrings

func TrackCostFromStrings(toolName, serverName, requestJSON, responseJSON string)

Types

type Clock

type Clock interface {
	Now() time.Time
	Since(time.Time) time.Duration
}

type CostBreakdown

type CostBreakdown struct {
	ByTool   []ToolCost    `json:"by_tool"`
	ByServer []ServerCost  `json:"by_server"`
	Total    int64         `json:"total"`
	Duration time.Duration `json:"duration"`
}

type CostTracker

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

func GlobalCostTracker

func GlobalCostTracker() *CostTracker

func NewCostTracker

func NewCostTracker() *CostTracker

func (*CostTracker) FormatCLI

func (c *CostTracker) FormatCLI(showByTool, showByServer bool) string

func (*CostTracker) FormatJSON

func (c *CostTracker) FormatJSON() (string, error)

func (*CostTracker) GetBreakdown

func (c *CostTracker) GetBreakdown() CostBreakdown

func (*CostTracker) GetByServer

func (c *CostTracker) GetByServer() map[string]int64

func (*CostTracker) GetByTool

func (c *CostTracker) GetByTool() map[string]int64

func (*CostTracker) GetTotal

func (c *CostTracker) GetTotal() int64

func (*CostTracker) Reset

func (c *CostTracker) Reset()

func (*CostTracker) Track

func (c *CostTracker) Track(toolName, serverName string, tokenCount int64)

type RealClock

type RealClock struct{}

func (RealClock) Now

func (RealClock) Now() time.Time

func (RealClock) Since

func (RealClock) Since(t time.Time) time.Duration

type ServerCost

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

type ToolCost

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

Jump to

Keyboard shortcuts

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