metrics

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor interface {
	// In the future this should be a cursor or generator
	// pull everything into memory for right now for simplicity
	TableAccesses(ctx context.Context, conf *conf.LastUpdateConf) ([]TableAccess, error)
}

type ColumnChecker added in v0.0.2

type ColumnChecker struct {
}

type Columns added in v0.0.2

type Columns interface {
	Columns(ctx context.Context) ([]TableColumn, error)
}

type CompareChecker added in v0.0.2

type CompareChecker struct {
	Metrics    statsd.ClientInterface
	StaticConf *conf.StaticConf
	// contains filtered or unexported fields
}

func NewCompareChecker added in v0.0.2

func NewCompareChecker(ms statsd.ClientInterface, sc *conf.StaticConf, primaryDB *sql.DB) (*CompareChecker, error)

NewCompareChecker builds a compare checker and initializes all underlying resources.

func (*CompareChecker) Emit added in v0.0.2

func (cc *CompareChecker) Emit(cr ComparisonResult) error

func (*CompareChecker) ExecuteComp added in v0.0.2

func (cc *CompareChecker) ExecuteComp(ctx context.Context, comp conf.ComparisonSQLStatement) (map[string]Result, error)

func (*CompareChecker) Run added in v0.0.2

func (cc *CompareChecker) Run(ctx context.Context) error

type Comparison added in v0.0.2

type Comparison struct {
	Results []ComparisonResult
}

type ComparisonResult added in v0.0.2

type ComparisonResult struct {
	Name   string
	First  Result
	Second Result
}

func (ComparisonResult) Key added in v0.0.3

func (cr ComparisonResult) Key() string

func (ComparisonResult) RatioFirstToSecond added in v0.0.2

func (cr ComparisonResult) RatioFirstToSecond() float64

func (ComparisonResult) TargetName added in v0.0.2

func (cr ComparisonResult) TargetName() string

type FreshnessChecker

type FreshnessChecker struct {
	Metrics    statsd.ClientInterface
	StaticConf *conf.StaticConf
	Fr         Freshnesser
}

func (*FreshnessChecker) Emit

func (fc *FreshnessChecker) Emit(tf TableFreshness) (bool, error)

func (*FreshnessChecker) EmitAll

func (fc *FreshnessChecker) EmitAll(tfs []TableFreshness) error

func (*FreshnessChecker) Run

func (fc *FreshnessChecker) Run(ctx context.Context) error

type Freshnesser

type Freshnesser interface {
	Freshness(ctx context.Context, conf *conf.FreshnessConf) ([]TableFreshness, error)
}

type LastAccessor

type LastAccessor struct {
	Metrics    statsd.ClientInterface
	StaticConf *conf.StaticConf
	Accessor   Accessor
	// contains filtered or unexported fields
}

func NewLastAccessor

func NewLastAccessor(ms statsd.ClientInterface, sc *conf.StaticConf, accessor Accessor) (*LastAccessor, error)

func (*LastAccessor) Emit

func (l *LastAccessor) Emit(ta TableAccess, sm map[string]struct{}) (bool, error)

func (*LastAccessor) EmitAll

func (l *LastAccessor) EmitAll(tas []TableAccess) error

func (*LastAccessor) QueryAccesses

func (l *LastAccessor) QueryAccesses(ctx context.Context) error

type Result added in v0.0.2

type Result struct {
	Key  string
	Name string
	DB   string
	Rows int
}

type SQLContext added in v0.0.2

type SQLContext struct {
	Env map[string]string
}

type TableAccess

type TableAccess struct {
	Schema     string
	Table      string
	LastInsert time.Time
	Rows       int
}

type TableColumn added in v0.0.2

type TableColumn struct {
	Database string
	Schema   string
	Table    string
	Column   string
	Type     string
	Length   int
}

type TableFreshness

type TableFreshness struct {
	Database   string
	Schema     string
	Table      string
	LastRecord time.Time
	Column     string
	Tags       []string
}

Jump to

Keyboard shortcuts

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