stats

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package stats provides atomic counters for operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatType

type StatType int

StatType is an enum for our various types of stats.

const (
	// Fail is failed jobs
	Fail StatType = iota

	// S3Op is successful S3 operations
	S3Op

	// FileOp is successful File operations
	FileOp

	// ShellOp is successful shell invocations
	ShellOp

	// RetryOp is retried operations
	RetryOp
)

type Stats

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

Stats contain the number of operations of each StatType

func (*Stats) Get

func (s *Stats) Get(t StatType) (value uint64)

Get atomically reads the StatType's number of operations value

func (*Stats) Increment

func (s *Stats) Increment(t StatType)

Increment atomically increments the StatType's counter

func (*Stats) IncrementIfSuccess

func (s *Stats) IncrementIfSuccess(t StatType, err error) error

IncrementIfSuccess atomically increments the StatType's counter in Stats if err is nil

Jump to

Keyboard shortcuts

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