stats

package
v0.1.889 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package stats counts magpie's users: once a day a running magpie tells PostHog it is in use, under an id made up on this computer, with its version and system. Nothing else goes: no names, accounts, keys, models, prompts or usage. Settings → Privacy turns it off, and so do DO_NOT_TRACK=1 and MAGPIE_NO_STATS=1; a build from source never sends it.

Index

Constants

View Source
const Key = "phc_nyDyYyrUTRGvNq5U7FBesCyM2j4GdKeqGp8ko7DBerTC"

Key is the Magpie project's key on PostHog: it can send events there and read nothing, so it is safe in the app.

Variables

This section is empty.

Functions

func Host

func Host() string

Host takes the events; MAGPIE_STATS_HOST points them elsewhere, for testing.

func Off

func Off() bool

Off reports whether the user said not to send it.

func Run

func Run(version, what string)

Run sends the day's event while magpie runs, as what ("app", "serve"): at start, and then whenever a new day (UTC) has begun. Only releases send it, unless MAGPIE_STATS_HOST is set.

func Send

func Send(ctx context.Context, version, what string, now time.Time) error

Send sends the event for now's day, unless it went already or the user turned it off.

Types

This section is empty.

Jump to

Keyboard shortcuts

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