analytics

package
v0.99.18 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package analytics is Flowbot's personal and ops statistics module.

Index

Constants

View Source
const Name = "analytics"

Name is the module registry key.

Variables

This section is empty.

Functions

func OnService

func OnService(fn func(*Service))

OnService registers a listener invoked whenever the analytics service instance is assigned.

func Register

func Register()

Register registers the analytics module.

Types

type Service

type Service struct{}

Service orchestrates analytics queries across domain stores.

func ActiveService

func ActiveService() *Service

ActiveService returns the current analytics service, or nil when disabled.

func NewService

func NewService() *Service

NewService returns an analytics service.

func (*Service) ActivityStats

func (*Service) ActivityStats(ctx context.Context, uid string, since, until time.Time) (*types.ActivityStats, error)

ActivityStats returns personal pipeline/function run counts.

func (*Service) EventStats

func (*Service) EventStats(ctx context.Context, uid string, since, until time.Time, groupBy string) (*types.EventStats, error)

EventStats proxies data_events aggregation for the signed-in user.

func (*Service) OpsRunsHealth

func (*Service) OpsRunsHealth(ctx context.Context, since, until time.Time, groupBy string) (
	pipe *types.PipelineStats,
	wf *types.WorkflowStats,
	fn *types.FunctionStats,
	err error,
)

OpsRunsHealth returns site-wide pipeline, workflow, and function health stats.

func (*Service) Overview

func (*Service) Overview(ctx context.Context, uid string, since, until time.Time, activeRange, rangeLabel string) (*types.AnalyticsOverview, error)

Overview returns Personal + Ops headline counters for the landing page.

func (*Service) TokenUsage

func (*Service) TokenUsage(ctx context.Context, uid string, since, until time.Time, groupBy string) (*types.TokenUsageStats, error)

TokenUsage proxies LLM usage stats for the signed-in user.

Jump to

Keyboard shortcuts

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