metrics

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CLISource is sent for cli metrics
	CLISource = "cli"
	// APISource is sent for API metrics
	APISource = "api"
	// SuccessStatus is sent for API metrics
	SuccessStatus = "success"
	// FailureStatus is sent for API metrics
	FailureStatus = "failure"
	// CanceledStatus is sent for API metrics
	CanceledStatus = "canceled"
)

Variables

This section is empty.

Functions

func GetCommand added in v0.1.19

func GetCommand(args []string, flags *flag.FlagSet) string

GetCommand get the invoked command

func Track

func Track(context string, args []string, flags *flag.FlagSet, status string)

Track sends the tracking analytics to Docker Desktop

Types

type Client

type Client interface {
	// Send sends the command to Docker Desktop. Note that the function doesn't
	// return anything, not even an error, this is because we don't really care
	// if the metrics were sent or not. We only fire and forget.
	Send(Command)
}

Client sends metrics to Docker Desktopn

func NewClient

func NewClient() Client

NewClient returns a new metrics client

type Command

type Command struct {
	Command string `json:"command"`
	Context string `json:"context"`
	Source  string `json:"source"`
	Status  string `json:"status"`
}

Command is a command

Jump to

Keyboard shortcuts

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