Documentation
¶
Index ¶
- Variables
- type DailyStats
- type MemoryStore
- func (s *MemoryStore) GetDailyStats(dateStr string) DailyStats
- func (s *MemoryStore) GetEndpointStatus(endpointID string, minute int64) (int64, int64)
- func (s *MemoryStore) GetGlobalStatus(minute int64) (int64, int64)
- func (s *MemoryStore) GetModelStatus(modelCode string, minute int64) (int64, int64)
- func (s *MemoryStore) GetOpenEndpoints() []string
- func (s *MemoryStore) GetOpenServices() []string
- func (s *MemoryStore) Record(m RequestMetric)
- func (s *MemoryStore) UpdateCircuitBreakers(endpoints []string, services []string)
- type RequestMetric
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalStore = NewMemoryStore()
Functions ¶
This section is empty.
Types ¶
type DailyStats ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) GetDailyStats ¶
func (s *MemoryStore) GetDailyStats(dateStr string) DailyStats
func (*MemoryStore) GetEndpointStatus ¶
func (s *MemoryStore) GetEndpointStatus(endpointID string, minute int64) (int64, int64)
func (*MemoryStore) GetGlobalStatus ¶
func (s *MemoryStore) GetGlobalStatus(minute int64) (int64, int64)
func (*MemoryStore) GetModelStatus ¶
func (s *MemoryStore) GetModelStatus(modelCode string, minute int64) (int64, int64)
func (*MemoryStore) GetOpenEndpoints ¶
func (s *MemoryStore) GetOpenEndpoints() []string
func (*MemoryStore) GetOpenServices ¶
func (s *MemoryStore) GetOpenServices() []string
func (*MemoryStore) Record ¶
func (s *MemoryStore) Record(m RequestMetric)
func (*MemoryStore) UpdateCircuitBreakers ¶
func (s *MemoryStore) UpdateCircuitBreakers(endpoints []string, services []string)
type RequestMetric ¶
type RequestMetric struct {
Time int64 `json:"time"` // Unix timestamp
Model string `json:"model"`
Success bool `json:"success"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CachedTokens int64 `json:"cached_tokens"`
CacheCreationTokens int64 `json:"cache_creation_tokens"`
Cost float64 `json:"cost"`
Attempts []struct {
EndpointID string `json:"endpoint_id"`
Success bool `json:"success"`
} `json:"attempts"`
}
Click to show internal directories.
Click to hide internal directories.