stats

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stats handles tracking and retrieval of commit statistics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAverageLatency

func GetAverageLatency() (float64, error)

GetAverageLatency returns the average latency in seconds

func GetLastUsed

func GetLastUsed() (time.Time, error)

GetLastUsed returns the time of the last commit

func GetMostUsedModel

func GetMostUsedModel() (string, error)

GetMostUsedModel returns the most frequently used model

func GetTotalCommits

func GetTotalCommits() (int, error)

GetTotalCommits returns the total number of commits

func RecordCommit

func RecordCommit(model string, latency float64, commitMsg string) error

RecordCommit adds a new commit record to the stats

func Save

func Save(stats *Stats) error

Save writes statistics to disk

Types

type CommitRecord

type CommitRecord struct {
	Timestamp time.Time `json:"timestamp"`
	Model     string    `json:"model"`
	Latency   float64   `json:"latency"` // in seconds
	CommitMsg string    `json:"commit_msg"`
}

CommitRecord represents a single commit record

func GetRecentCommits

func GetRecentCommits(limit int) ([]CommitRecord, error)

GetRecentCommits returns the most recent commits (up to limit)

type Stats

type Stats struct {
	Commits []CommitRecord `json:"commits"`
}

Stats represents all commit statistics

func Load

func Load() (*Stats, error)

Load reads statistics from disk

Jump to

Keyboard shortcuts

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