mock

package
v0.0.0-...-c49be44 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	SetCandidateRevisionFn      func(revisionName string)
	SetCandidateRevisionInvoked bool

	RequestCountFn      func(ctx context.Context, offset time.Duration) (int64, error)
	RequestCountInvoked bool

	LatencyFn      func(ctx context.Context, offset time.Duration, alignReduceType metrics.AlignReduce) (float64, error)
	LatencyInvoked bool

	ErrorRateFn      func(ctx context.Context, offset time.Duration) (float64, error)
	ErrorRateInvoked bool
}

Metrics is a mock implementation of metrics.Metrics.

func (*Metrics) ErrorRate

func (m *Metrics) ErrorRate(ctx context.Context, offset time.Duration) (float64, error)

ErrorRate invokes the mock implementation and marks the function as invoked.

func (*Metrics) Latency

func (m *Metrics) Latency(ctx context.Context, offset time.Duration, alignReduceType metrics.AlignReduce) (float64, error)

Latency invokes the mock implementation and marks the function as invoked.

func (*Metrics) RequestCount

func (m *Metrics) RequestCount(ctx context.Context, offset time.Duration) (int64, error)

RequestCount invokes the mock implementation and marks the function as invoked.

func (*Metrics) SetCandidateRevision

func (m *Metrics) SetCandidateRevision(revisionName string)

SetCandidateRevision invokes the mock implementation and marks the function as invoked.

type Query

type Query struct{}

Query is a mock implementation of metrics.Query.

func (Query) Query

func (q Query) Query() string

Query returns an empty string to comply with the interface.

Jump to

Keyboard shortcuts

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