analytics

package
v0.2.32 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package analytics provides the methods to run an analytics reporting system for API requests which may be useful to users for measuring access and possibly identifying bad actors abusing requests.

Index

Constants

View Source
const RANGE = 14

RANGE determines the number of days hugoverse request analytics and metrics are stored and displayed within the system

Variables

This section is empty.

Functions

func Backup

func Backup(ctx context.Context, res http.ResponseWriter) error

Backup writes a snapshot of the system.db database to an HTTP response. The output is discarded if we get a cancellation signal.

func ChartData

func ChartData() (map[string]interface{}, error)

ChartData returns the map containing decoded javascript needed to chart RANGE days of data by day

func Close

func Close()

Close exports the abillity to close our db file. Should be called with defer after call to Setup() from the same place.

func Record

func Record(req *http.Request)

Record queues an apiRequest for metrics

func Setup

func Setup(dataDir string)

Setup creates a db connection, initializes the db with schema and data and sets up the queue/batching channel

Types

This section is empty.

Jump to

Keyboard shortcuts

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