analytics

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ChartLimit = 12
View Source
const SessionOptionLimit = 100

Variables

This section is empty.

Functions

func ReportingTimezone

func ReportingTimezone(location *time.Location, now time.Time) string

Prefer a rule-bearing IANA name so clients format historical DST correctly. Unnamed/local installations fall back to an explicitly fixed current offset.

Types

type Dashboard

type Dashboard struct {
	FactCount     int64
	Generation    int64
	InputRevision int64
	Pending       int64
	Unresolved    int64
	Quality       string
	Revision      int64
	DatabaseID    string
	DatasetID     string
	Rows          []Row
	Chart         []Row
	RowCount      int
	Page          int
	PageSize      int
	Summary       querymodel.ViewerSummaryRow
	LastSynced    int64
	Range         string
}

type Facets

type Facets struct {
	Providers, Models, Harnesses, Sessions []string
	Repositories, Directories              []querymodel.LocationOption
	Revision, Generation, InputRevision    int64
	DatabaseID, DatasetID                  string
}

Facets contains filter choices from one dataset and one read snapshot.

type ProcessingStatus

type ProcessingStatus struct {
	Metadata        dataengine.Metadata
	Pending         int64
	Failed          int64 // Pending scopes with a durable error; completed scopes are excluded.
	FailedRetryAtMs int64 // Earliest retry time among failed pending scopes.
	Hostname        string
}

ProcessingStatus describes one dataset without exposing storage to HTTP adapters.

type Query

type Query struct {
	Quality        string
	Selection      viewer.Selection
	Tab            string
	LocationGroup  querymodel.RepoGroup
	RepositoryKeys []string
	DirectoryKeys  []string
	Sort           string
	Direction      string
	Page           int
	PageSize       int
}

func ParseQuery

func ParseQuery(values url.Values) (Query, error)

type Repository

type Repository interface {
	// Dashboard clamps page after counting; rows, summary and revisions agree.
	Dashboard(context.Context, Query, time.Time) (Dashboard, error)
	// AllDashboard returns complete sorted rows or an error when the limit is
	// exceeded, never a successful truncation or separately snapshotted pages.
	AllDashboard(context.Context, Query, time.Time, int) (Dashboard, error)
	// Each call owns its snapshot; separate calls may observe newer revisions.
	Facets(context.Context, Query, string, time.Time) (Facets, error)
	// Status distinguishes accepted inputs, published revision and rebuild target.
	Status(context.Context) (ProcessingStatus, error)
}

Repository reads one authorized dataset. Implementations must return rows, totals and publication metadata from a consistent snapshot. No query can select a different dataset through user-supplied filter values.

type Row

type Row struct {
	Key                 string
	Name                string
	Harness             string
	Provider            string
	Model               string
	Date                int64
	Sessions            int64
	Input               int64
	Output              int64
	Reasoning           int64
	CacheRead           int64
	CacheWrite          int64
	Total               int64
	Context             int64
	AverageContext      int64
	MedianContext       int64
	MaxContext          int64
	LocationKey         string
	LocationName        string
	DirectoryNames      []string
	HasUnknownDirectory bool
	RepositoryKey       string
	RepositoryName      string
}

Row is a numeric analytics result, independent of API transport.

Jump to

Keyboard shortcuts

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