analytics

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TagGitRepoHash = "git.origin"
View Source
const TagOS = "os"
View Source
const TagSubcommand = "subcommand"
View Source
const TagVersion = "version"

Variables

This section is empty.

Functions

func HashMD5 added in v0.10.0

func HashMD5(s string) string

func IsAnalyticsDisabledFromEnv added in v0.10.16

func IsAnalyticsDisabledFromEnv() (bool, string)

If analytics is disabled, return a string representing a human-readable reason.

func WithAnalytics added in v0.8.7

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

Types

type AnalyticsOpter

type AnalyticsOpter interface {
	SetUserOpt(opt analytics.Opt) error
	ReadUserOpt() (analytics.Opt, error)
}

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

type FakeOpter added in v0.10.16

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

func DefaultFakeOpter added in v0.10.16

func DefaultFakeOpter() *FakeOpter

func NewFakeOpter added in v0.10.16

func NewFakeOpter(initialOpt analytics.Opt) *FakeOpter

func (*FakeOpter) Calls added in v0.10.16

func (to *FakeOpter) Calls() []analytics.Opt

func (*FakeOpter) ReadUserOpt added in v0.10.16

func (to *FakeOpter) ReadUserOpt() (analytics.Opt, error)

func (*FakeOpter) SetUserOpt added in v0.10.16

func (to *FakeOpter) SetUserOpt(opt analytics.Opt) error

func (*FakeOpter) WaitUntilCount added in v0.10.16

func (to *FakeOpter) WaitUntilCount(t *testing.T, expectedCount int)

type TiltAnalytics

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

An Analytics that 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(opter AnalyticsOpter, a analytics.Analytics, tiltVersion string) (*TiltAnalytics, error)

func (*TiltAnalytics) Count

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

func (*TiltAnalytics) EffectiveOpt added in v0.10.16

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

func (*TiltAnalytics) Flush

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

func (*TiltAnalytics) GitRepoHash added in v0.10.16

func (ta *TiltAnalytics) GitRepoHash() string

func (*TiltAnalytics) GlobalTag added in v0.10.16

func (ta *TiltAnalytics) GlobalTag(name string) (string, bool)

func (*TiltAnalytics) Incr

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

func (*TiltAnalytics) MachineHash added in v0.10.16

func (ta *TiltAnalytics) MachineHash() string

func (*TiltAnalytics) SetTiltfileOpt added in v0.10.16

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

func (*TiltAnalytics) SetUserOpt added in v0.10.16

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

func (*TiltAnalytics) TiltfileOpt added in v0.10.16

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

func (*TiltAnalytics) Timer

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

func (*TiltAnalytics) UserOpt added in v0.10.16

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

func (*TiltAnalytics) WithoutGlobalTags added in v0.14.0

func (ta *TiltAnalytics) WithoutGlobalTags() analytics.Analytics

Jump to

Keyboard shortcuts

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