store

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Summary added in v0.10.0

type Summary struct {
	APIMethod       string
	TotalRequests   int64
	SuccessRequests int64
	FailureRequests int64
	AverageLatency  float64
}

Summary is a struct that represents the summary of the usage data.

func AggregatedUsage added in v1.8.0

func AggregatedUsage(s *store.Store, tenantID string, start, end int64) ([]Summary, error)

AggregatedUsage returns the aggregated usage data for the given tenant and time range.

type UsageByGroup added in v1.3.0

type UsageByGroup struct {
	APIKeyID string
	UserID   string
	ModelID  string

	TotalRequests           int64
	TotalPromptTokens       int64
	TotalCompletionTokens   int64
	AverageLatency          float64
	AverageTimeToFirstToken float64
}

UsageByGroup represents the aggregated usage data grouped by API key, user, and model.

func GetUsagesByGroups added in v1.8.0

func GetUsagesByGroups(s *store.Store, tenantID string, start, end int64) ([]*UsageByGroup, error)

GetUsagesByGroups returns the aggregated usage data by groups for the given tenant and time range.

Jump to

Keyboard shortcuts

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