telemetry

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0, MIT, MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectInfo

type CollectInfo struct {
	ID         string   `json:"id,omitempty"` // hashed cluster name
	Mode       string   `json:"mode,omitempty"`
	ArgYes     bool     `json:"arg_yes,omitempty"`   // if the `--yes` argument is applied
	ArgLimit   int      `json:"arg_limit,omitempty"` // value of `-l/--limit` argument
	ArgInclude []string `json:"arg_include,omitempty"`
	ArgExclude []string `json:"arg_exclude,omitempty"`
	TimeSpan   int64    `json:"time_span,omitempty"`
	DataSize   int64    `json:"data_size,omitempty"` // data set size

}

CollectInfo is about the `collect` subcommand

type PackageInfo

type PackageInfo struct {
	OriginalSize int64 `json:"original_size,omitempty"` // data set size
	PackageSize  int64 `json:"package_size,omitempty"`  // package size (compressed)
}

PackageInfo is about the `package` subcommand

type RebuildInfo

type RebuildInfo struct {
	DataSize    int64 `json:"data_size,omitempty"`   // data set size
	Local       bool  `json:"local,omitempty"`       // if `--local` set
	Concurrency int   `json:"concurrency,omitempty"` // `-c`
}

RebuildInfo is about the `rebuild` subcommand

type Report

type Report struct {
	UUID          string       `json:"uuid,omitempty"`
	Version       *VersionInfo `json:"version,omitempty"`
	Command       string       `json:"command,omitempty"`
	CommandInfo   interface{}  `json:"command_info,omitempty"`
	ExecutionTime uint64       `json:"exec_time,omitempty"`
	ExitCode      int32        `json:"exit_code,omitempty"`
}

Report is the main telemetry message of diag

type Telemetry

type Telemetry struct {
	// contains filtered or unexported fields
}

Telemetry control telemetry.

func NewTelemetry

func NewTelemetry() *Telemetry

NewTelemetry return a new Telemetry instance.

func (*Telemetry) Report

func (t *Telemetry) Report(ctx context.Context, msg *Report) error

Report report the msg right away.

type UploadInfo

type UploadInfo struct {
	PackageInfo

	Endpoint string `json:"endpoint,omitempty"`
}

UploadInfo is about the `upload` subcommand

type VersionInfo

type VersionInfo struct {
	Release   string `json:"release,omitempty"`
	GitRef    string `json:"git_ref,omitempty"`
	GitCommit string `json:"git_commit,omitempty"`
	Os        string `json:"os,omitempty"`
	Arch      string `json:"arch,omitempty"`
	Go        string `json:"go,omitempty"`
}

VersionInfo holds the version of the particular binary

func GetVersion

func GetVersion() *VersionInfo

GetVersion populates VersionInfo

Jump to

Keyboard shortcuts

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