telemetrydata

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

View Source
var ValidEventNames = map[string]bool{
	"app:startup":  true,
	"app:shutdown": true,
	"app:activity": true,
	"app:display":  true,
	"app:counts":   true,

	"action:magnify":     true,
	"action:settabtheme": true,
	"action:createtab":   true,
	"action:createblock": true,
	"action:other":       true,
	"action:term":        true,
	"action:termdurable": true,
	"action:link":        true,

	"wsh:run": true,

	"debug:panic": true,

	"conn:connect":      true,
	"conn:connecterror": true,
	"conn:nowsh":        true,

	"onboarding:start":      true,
	"onboarding:skip":       true,
	"onboarding:fire":       true,
	"onboarding:githubstar": true,

	"job:start":     true,
	"job:reconnect": true,
	"job:done":      true,
}

Functions

This section is empty.

Types

type TEvent

type TEvent struct {
	Uuid    string      `json:"uuid,omitempty" db:"uuid"`
	Ts      int64       `json:"ts,omitempty" db:"ts"`
	TsLocal string      `json:"tslocal,omitempty" db:"tslocal"` // iso8601 format (wall clock converted to PT)
	Event   string      `json:"event" db:"event"`
	Props   TEventProps `json:"props" db:"-"` // Don't scan directly to map

	// DB fields
	Uploaded bool `json:"-" db:"uploaded"`

	// For database scanning
	RawProps string `json:"-" db:"props"`
}

func MakeTEvent

func MakeTEvent(event string, props TEventProps) *TEvent

func MakeUntypedTEvent

func MakeUntypedTEvent(event string, propsMap map[string]any) (*TEvent, error)

func (*TEvent) ConvertRawJSON

func (t *TEvent) ConvertRawJSON() error

func (*TEvent) EnsureTimestamps

func (t *TEvent) EnsureTimestamps()

func (*TEvent) UserSetOnceProps

func (t *TEvent) UserSetOnceProps() *TEventUserProps

func (*TEvent) UserSetProps

func (t *TEvent) UserSetProps() *TEventUserProps

func (*TEvent) Validate

func (te *TEvent) Validate(current bool) error

validates a tevent that was just created (not for validating out of the DB, or an uploaded TEvent) checks that TS is pretty current (or unset)

type TEventProps

type TEventProps struct {
	TEventUserProps `tstype:"-"` // generally don't need to set these since they will be automatically copied over

	ActiveMinutes       int `json:"activity:activeminutes,omitempty"`
	FgMinutes           int `json:"activity:fgminutes,omitempty"`
	OpenMinutes         int `json:"activity:openminutes,omitempty"`
	TermCommandsRun     int `json:"activity:termcommandsrun,omitempty"`
	TermCommandsRemote  int `json:"activity:termcommands:remote,omitempty"`
	TermCommandsDurable int `json:"activity:termcommands:durable,omitempty"`
	TermCommandsWsl     int `json:"activity:termcommands:wsl,omitempty"`

	AppFirstDay    bool `json:"app:firstday,omitempty"`
	AppFirstLaunch bool `json:"app:firstlaunch,omitempty"`

	ActionInitiator string `json:"action:initiator,omitempty" tstype:"\"keyboard\" | \"mouse\""`
	ActionType      string `json:"action:type,omitempty"`

	PanicType string `json:"debug:panictype,omitempty"`

	BlockView       string `json:"block:view,omitempty"`
	BlockController string `json:"block:controller,omitempty"`
	BlockSubBlock   bool   `json:"block:subblock,omitempty"`

	WshCmd        string `json:"wsh:cmd,omitempty"`
	WshErrorCount int    `json:"wsh:errorcount,omitempty"`
	WshCount      int    `json:"wsh:count,omitempty"`

	ConnType         string `json:"conn:conntype,omitempty"`
	ConnWshErrorCode string `json:"conn:wsherrorcode,omitempty"`
	ConnErrorCode    string `json:"conn:errorcode,omitempty"`
	ConnSubErrorCode string `json:"conn:suberrorcode,omitempty"`
	ConnContextError bool   `json:"conn:contexterror,omitempty"`

	OnboardingFeature    string `json:"onboarding:feature,omitempty" tstype:"\"durable\" | \"blocks\" | \"files\""`
	OnboardingVersion    string `json:"onboarding:version,omitempty"`
	OnboardingGithubStar string `json:"onboarding:githubstar,omitempty" tstype:"\"already\" | \"star\" | \"later\""`
	OnboardingPage       string `json:"onboarding:page,omitempty"`

	DisplayHeight int         `json:"display:height,omitempty"`
	DisplayWidth  int         `json:"display:width,omitempty"`
	DisplayDPR    float64     `json:"display:dpr,omitempty"`
	DisplayCount  int         `json:"display:count,omitempty"`
	DisplayAll    interface{} `json:"display:all,omitempty"`

	CountBlocks        int            `json:"count:blocks,omitempty"`
	CountTabs          int            `json:"count:tabs,omitempty"`
	CountWindows       int            `json:"count:windows,omitempty"`
	CountWorkspaces    int            `json:"count:workspaces,omitempty"`
	CountSSHConn       int            `json:"count:sshconn,omitempty"`
	CountWSLConn       int            `json:"count:wslconn,omitempty"`
	CountJobs          int            `json:"count:jobs,omitempty"`
	CountJobsConnected int            `json:"count:jobsconnected,omitempty"`
	CountViews         map[string]int `json:"count:views,omitempty"`

	JobDoneReason string `json:"job:donereason,omitempty"`
	JobKind       string `json:"job:kind,omitempty"`

	UserSet     *TEventUserProps `json:"$set,omitempty"`
	UserSetOnce *TEventUserProps `json:"$set_once,omitempty"`
}

type TEventUserProps

type TEventUserProps struct {
	ClientArch           string `json:"client:arch,omitempty"`
	ClientVersion        string `json:"client:version,omitempty"`
	ClientInitialVersion string `json:"client:initial_version,omitempty"`
	ClientBuildTime      string `json:"client:buildtime,omitempty"`
	ClientOSRelease      string `json:"client:osrelease,omitempty"`
	ClientIsDev          bool   `json:"client:isdev,omitempty"`
	ClientPackageType    string `json:"client:packagetype,omitempty"`
	ClientMacOSVersion   string `json:"client:macos,omitempty"`

	CohortMonth   string `json:"cohort:month,omitempty"`
	CohortISOWeek string `json:"cohort:isoweek,omitempty"`

	AutoUpdateChannel string `json:"autoupdate:channel,omitempty"`
	AutoUpdateEnabled bool   `json:"autoupdate:enabled,omitempty"`

	LocalShellType    string `json:"localshell:type,omitempty"`
	LocalShellVersion string `json:"localshell:version,omitempty"`

	LocCountryCode string `json:"loc:countrycode,omitempty"`
	LocRegionCode  string `json:"loc:regioncode,omitempty"`

	SettingsCustomWidgets  int  `json:"settings:customwidgets,omitempty"`
	SettingsCustomSettings int  `json:"settings:customsettings,omitempty"`
	SettingsSecretsCount   int  `json:"settings:secretscount,omitempty"`
	SettingsTransparent    bool `json:"settings:transparent,omitempty"`
}

Jump to

Keyboard shortcuts

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