analytics

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAnalytics added in v0.8.7

func WithAnalytics(ctx context.Context, a *TiltAnalytics) context.Context

Types

type AnalyticsOpter

type AnalyticsOpter interface {
	SetOpt(opt analytics.Opt) error
}

An AnalyticsOpter can record a user's choice (opt-in or opt-out) in re: Tilt recording analytics.

type NullOpter

type NullOpter struct{}

func (NullOpter) SetOpt

func (NullOpter) SetOpt(opt analytics.Opt) error

type TiltAnalytics

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

An Analytics that:

  1. Has `IncrIfUnopted` to report anonymous metrics only for users who have not opted in/out (or the choice that they did opt in/out).
  2. Ignores all other calls from users who have not opted in.
  3. Allows opting in/out at runtime.

func Get added in v0.8.7

func Get(ctx context.Context) *TiltAnalytics

func NewMemoryTiltAnalyticsForTest added in v0.8.8

func NewMemoryTiltAnalyticsForTest(opter AnalyticsOpter) (*analytics.MemoryAnalytics, *TiltAnalytics)

NOTE: if you need a ctx as well, use testutils.CtxAndAnalyticsForTest so that you get a ctx with the correct analytics baked in.

func NewTiltAnalytics

func NewTiltAnalytics(opt analytics.Opt, opter AnalyticsOpter, analytics analytics.Analytics, tiltVersion string) *TiltAnalytics

func (*TiltAnalytics) Count

func (ta *TiltAnalytics) Count(name string, tags map[string]string, n int)

func (*TiltAnalytics) Flush

func (ta *TiltAnalytics) Flush(timeout time.Duration)

func (*TiltAnalytics) Incr

func (ta *TiltAnalytics) Incr(name string, tags map[string]string)

func (*TiltAnalytics) IncrAnonymous

func (ta *TiltAnalytics) IncrAnonymous(name string, tags map[string]string)

func (*TiltAnalytics) IncrIfUnopted

func (ta *TiltAnalytics) IncrIfUnopted(name string)

func (*TiltAnalytics) Opt added in v0.8.7

func (ta *TiltAnalytics) Opt() analytics.Opt

func (*TiltAnalytics) SetOpt

func (ta *TiltAnalytics) SetOpt(opt analytics.Opt) error

func (*TiltAnalytics) Timer

func (ta *TiltAnalytics) Timer(name string, dur time.Duration, tags map[string]string)

Jump to

Keyboard shortcuts

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