Help us shape the future of Go! Take the 2026 Go Developer Survey

stats

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2017 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package stats provides CLI analytics.

Index

Constants

This section is empty.

Variables

View Source
var Client = func() *analytics.Analytics {
	e := env.Get()

	sess, err := session.NewSession(&aws.Config{
		Credentials: credentials.NewStaticCredentials(
			e.AWSAccessKey,
			e.AWSSecretKey,
			"",
		),
		Region: aws.String(e.AWSRegion),
	})
	if err != nil {
		log.Debugf("aws session not found")
		sess = nil
	}

	return analytics.New(&analytics.Config{
		Stream:  e.FirehoseStream,
		Session: sess,
		Prefix:  "joy:",
		Dir:     "joy",
	})
}()

Client sets up the AWS tracking client

Functions

func Increment

func Increment(db *skv.KVStore) (runs int, err error)

Increment runs

func Track

func Track(name string, fields map[string]interface{}) error

Track event `name` with optional `props`.

func TrackError

func TrackError(name string, now time.Time, err *error) error

TrackError tracks event `name` with errors

Types

This section is empty.

Jump to

Keyboard shortcuts

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