usage

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsManager

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

StatsManager handles usage statistics tracking and persistence.

func NewStatsManager

func NewStatsManager() (*StatsManager, error)

NewStatsManager creates a new statistics manager instance.

func (*StatsManager) GetCacheHitRate

func (sm *StatsManager) GetCacheHitRate() float64

GetCacheHitRate returns the cache hit rate as a percentage.

func (*StatsManager) GetMostUsedProvider

func (sm *StatsManager) GetMostUsedProvider() (types.LLMProvider, int)

GetMostUsedProvider returns the provider with the highest usage count.

func (*StatsManager) GetProviderRanking

func (sm *StatsManager) GetProviderRanking() []types.LLMProvider

GetProviderRanking returns providers ranked by usage count.

func (*StatsManager) GetStats

func (sm *StatsManager) GetStats() *types.UsageStats

GetStats returns a copy of the current usage statistics.

func (*StatsManager) GetSuccessRate

func (sm *StatsManager) GetSuccessRate() float64

GetSuccessRate returns the overall success rate as a percentage.

func (*StatsManager) RecordGeneration

func (sm *StatsManager) RecordGeneration(event *types.GenerationEvent) error

RecordGeneration records a commit message generation event.

func (*StatsManager) ResetStats

func (sm *StatsManager) ResetStats() error

ResetStats clears all usage statistics.

Jump to

Keyboard shortcuts

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