stats

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stats provides simple local usage statistics for personal assistant systems. This is a lightweight alternative to enterprise monitoring solutions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector collects and manages usage statistics.

func NewCollector

func NewCollector(st *store.Store) *Collector

NewCollector creates a new statistics collector.

func (*Collector) GetStats

func (c *Collector) GetStats() *Stats

GetStats returns a copy of current statistics.

func (*Collector) RecordAIQuery

func (c *Collector) RecordAIQuery()

RecordAIQuery records an AI query action.

func (*Collector) RecordSearch

func (c *Collector) RecordSearch()

RecordSearch records a search action.

func (*Collector) Start

func (c *Collector) Start(ctx context.Context)

Start begins periodic statistics collection. Updates every hour.

func (*Collector) Stop

func (c *Collector) Stop()

Stop stops the statistics collector.

type Stats

type Stats struct {
	LastSearchTime    time.Time
	LastUpdated       time.Time
	LastActivityTime  time.Time
	SearchesToday     int64
	ActiveDays        int64
	SchedulesThisWeek int64
	SchedulesNextWeek int64
	TotalSearches     int64
	TotalMemos        int64
	MemosLastMonth    int64
	TotalSchedules    int64
	MemosLastWeek     int64
	StreakDays        int64
	TotalAIQueries    int64
	AIQueriesToday    int64
	AIQueriesThisWeek int64
	Mu                sync.RWMutex
}

Stats represents usage statistics.

func (*Stats) GetSummary

func (s *Stats) GetSummary() string

GetSummary returns a human-readable summary.

Jump to

Keyboard shortcuts

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