stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stats aggregates a set of discovered sessions into a small summary — how many, where (by project), and when (by day) — for `cct stats`. It is a pure transform over already-scanned sessions: it reads nothing from disk and never touches an agent's files or index.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DayStat

type DayStat struct {
	Day   string // YYYY-MM-DD
	Count int
}

DayStat is one calendar day's session count (by last-activity / mtime).

type ProjectStat

type ProjectStat struct {
	Path  string
	Count int
}

ProjectStat is one project's session count, keyed by recorded cwd.

type Stats

type Stats struct {
	Total      int
	Parsed     int // sessions whose metadata parsed (have a thread id)
	Compressed int
	Archived   int
	NoCWD      int
	TotalBytes int64
	First      time.Time // earliest last-activity
	Last       time.Time // latest last-activity
	Projects   []ProjectStat
	Days       []DayStat
}

Stats is the computed summary.

func Compute

func Compute(list []sessions.Session) Stats

Compute summarizes the given sessions. Project grouping is case-insensitive on Windows to match the OS's path semantics; the first-seen spelling is kept.

Jump to

Keyboard shortcuts

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