Documentation
¶
Index ¶
- func Cleanup(days int) error
- func CountTokens(s string) int
- func FormatGain(s Stats) string
- func FormatHistory(records []Record) string
- func FormatSummary(summaries []CommandSummary) string
- func Init() error
- func Track(command string, rawTokens, filteredTokens int) error
- type CommandSummary
- type Record
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountTokens ¶
CountTokens returns the word count of a string (whitespace-split).
func FormatHistory ¶
FormatHistory formats history records for display.
func FormatSummary ¶ added in v0.5.1
func FormatSummary(summaries []CommandSummary) string
FormatSummary formats per-command aggregates.
Types ¶
type CommandSummary ¶ added in v0.5.1
type CommandSummary struct {
BaseCommand string
Count int
RawTokens int
SavedTokens int
SavingsPct float64
ZeroCount int // times with 0% savings
}
CommandSummary holds per-command aggregate stats.
func GetCommandSummary ¶ added in v0.5.1
func GetCommandSummary() ([]CommandSummary, error)
GetCommandSummary returns per-base-command aggregates, sorted by tokens saved descending.
Click to show internal directories.
Click to hide internal directories.