telemetry

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventScopeSystem = EventScope("system")
	EventScopeRun    = EventScope("run")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Version   string    `json:"v"`
	Timestamp time.Time `json:"ts"`

	RunID string `json:"run_id,omitempty"`

	Type    EventType `json:"type"`
	Payload Payload   `json:"payload"`
}

type EventScope added in v0.5.2

type EventScope string

type EventType

type EventType string

type LogPayload

type LogPayload struct {
	OpID   string `json:"op_id"`
	Data   string `json:"data"`
	Stream int    `json:"stream"`
}

func (LogPayload) Scope added in v0.5.2

func (LogPayload) Scope() EventScope

func (LogPayload) Type

func (LogPayload) Type() EventType

type OpPayload

type OpPayload struct {
	OpID     string        `json:"op_id"`
	OpName   string        `json:"op_name"`
	Pipeline pipeline.Path `json:"pipeline"`
	Internal bool          `json:"internal"`
	Inputs   []string      `json:"inputs"`

	Started   *time.Time `json:"started"`
	Completed *time.Time `json:"completed"`
	Cached    bool       `json:"cached"`
	Error     string     `json:"error"`
}

func (OpPayload) Scope added in v0.5.2

func (OpPayload) Scope() EventScope

func (OpPayload) Type

func (OpPayload) Type() EventType

type Payload

type Payload interface {
	Type() EventType
	Scope() EventScope
}

type Telemetry

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

func New

func New(printURLMessage bool) *Telemetry

func (*Telemetry) Disable

func (t *Telemetry) Disable()

func (*Telemetry) Enable

func (t *Telemetry) Enable()

func (*Telemetry) Flush

func (t *Telemetry) Flush()

func (*Telemetry) Push

func (t *Telemetry) Push(p Payload, ts time.Time)

func (*Telemetry) RunID

func (t *Telemetry) RunID() string

func (*Telemetry) SetRunID

func (t *Telemetry) SetRunID(id string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳