telemetry

package
v0.10.0-0.dev Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0

README

Go Telemetry

This repository holds the Go Telemetry server code and libraries.

Linting & Formatting

This repository uses eslint to format TS files, stylelint to format CSS files, and prettier to format TS, CSS, Markdown, and YAML files.

See the style guides:

It is encouraged that all TS and CSS code be run through formatters before submitting a change. However, it is not a strict requirement enforced by CI.

Installing npm Dependencies:
  1. Install docker
  2. Run ./npm install
Run ESLint, Stylelint, & Prettier
./npm run all

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/telemetry:" in the subject line, so it is easy to find.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mode

func Mode() string

Mode returns the current telemetry mode.

The telemetry mode is a global value that controls both the local collection and uploading of telemetry data. Possible mode values are:

  • "on": both collection and uploading is enabled
  • "local": collection is enabled, but uploading is disabled
  • "off": both collection and uploading are disabled

When mode is "on", or "local", telemetry data is written to the local file system and may be inspected with the gotelemetry command.

If an error occurs while reading the telemetry mode from the file system, Mode returns the default value "local".

func SetMode

func SetMode(mode string) error

SetMode sets the global telemetry mode to the given value.

See the documentation of Mode for a description of the supported mode values.

An error is returned if the provided mode value is invalid, or if an error occurs while persisting the mode value to the file system.

Types

type CounterConfig

type CounterConfig struct {
	Name  string
	Rate  float64 // If X <= Rate, report this counter
	Depth int     `json:",omitempty"` // for stack counters
}

type ProgramConfig

type ProgramConfig struct {
	// the counter names may have to be
	// repeated for each program. (e.g., if the counters are in a package
	// that is used in more than one program.)
	Name     string
	Versions []string        // versions present in a counterconfig
	Counters []CounterConfig `json:",omitempty"`
	Stacks   []CounterConfig `json:",omitempty"`
}

type ProgramReport

type ProgramReport struct {
	Program   string
	Version   string
	GoVersion string
	GOOS      string
	GOARCH    string
	Counters  map[string]int64
	Stacks    map[string]int64
}

type Report

type Report struct {
	Week     string  // first day this report covers (YYYY-MM-DD)
	LastWeek string  // Week field from latest previous report uploaded
	X        float64 // A random probability used to determine which counters are uploaded
	Programs []*ProgramReport
	Config   string // version of UploadConfig used
}

A Report is what's uploaded (or saved locally)

type UploadConfig

type UploadConfig struct {
	GOOS       []string
	GOARCH     []string
	GoVersion  []string
	SampleRate float64
	Programs   []*ProgramConfig
}

An UploadConfig controls what data is uploaded.

Directories

Path Synopsis
Package counter implements a simple counter system for collecting totally public telemetry data.
Package counter implements a simple counter system for collecting totally public telemetry data.
internal
config
package config provides methods for loading and querying a telemetry upload config file.
package config provides methods for loading and querying a telemetry upload config file.
configstore
Package configstore abstracts interaction with the telemetry config server.
Package configstore abstracts interaction with the telemetry config server.
counter
Package internal/counter implements the internals of the public counter package.
Package internal/counter implements the internals of the public counter package.
mmap
The mmap package provides an abstraction for memory mapping files on different platforms.
The mmap package provides an abstraction for memory mapping files on different platforms.
telemetry
Package telemetry manages the telemetry mode file.
Package telemetry manages the telemetry mode file.

Jump to

Keyboard shortcuts

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