stats

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender interface {
	Count(metric string, i int)
	Gauge(metric string, n int)
	GaugeMS(metric string, t time.Time)
}

A Sender is used to emit statsd type metrics.

func Discard

func Discard() Sender

func New

func New(s Service, cfg Statsd) (Sender, error)

New creates a new Sender which will send metrics to the receiver described by the cfg.Agent configuration. All metrics will be emittited under the application named by Service s.

type SenderMock

type SenderMock struct {
	CountMock mSenderMockCount

	GaugeMock mSenderMockGauge

	GaugeMSMock mSenderMockGaugeMS
	// contains filtered or unexported fields
}

SenderMock implements Sender

func NewSenderMock

func NewSenderMock(t minimock.Tester) *SenderMock

NewSenderMock returns a mock for Sender

func (*SenderMock) Count

func (mmCount *SenderMock) Count(metric string, i int)

Count implements Sender

func (*SenderMock) CountAfterCounter

func (mmCount *SenderMock) CountAfterCounter() uint64

CountAfterCounter returns a count of finished SenderMock.Count invocations

func (*SenderMock) CountBeforeCounter

func (mmCount *SenderMock) CountBeforeCounter() uint64

CountBeforeCounter returns a count of SenderMock.Count invocations

func (*SenderMock) Gauge

func (mmGauge *SenderMock) Gauge(metric string, n int)

Gauge implements Sender

func (*SenderMock) GaugeAfterCounter

func (mmGauge *SenderMock) GaugeAfterCounter() uint64

GaugeAfterCounter returns a count of finished SenderMock.Gauge invocations

func (*SenderMock) GaugeBeforeCounter

func (mmGauge *SenderMock) GaugeBeforeCounter() uint64

GaugeBeforeCounter returns a count of SenderMock.Gauge invocations

func (*SenderMock) GaugeMS

func (mmGaugeMS *SenderMock) GaugeMS(metric string, t time.Time)

GaugeMS implements Sender

func (*SenderMock) GaugeMSAfterCounter

func (mmGaugeMS *SenderMock) GaugeMSAfterCounter() uint64

GaugeMSAfterCounter returns a count of finished SenderMock.GaugeMS invocations

func (*SenderMock) GaugeMSBeforeCounter

func (mmGaugeMS *SenderMock) GaugeMSBeforeCounter() uint64

GaugeMSBeforeCounter returns a count of SenderMock.GaugeMS invocations

func (*SenderMock) MinimockCountDone

func (m *SenderMock) MinimockCountDone() bool

MinimockCountDone returns true if the count of the Count invocations corresponds the number of defined expectations

func (*SenderMock) MinimockCountInspect

func (m *SenderMock) MinimockCountInspect()

MinimockCountInspect logs each unmet expectation

func (*SenderMock) MinimockFinish

func (m *SenderMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*SenderMock) MinimockGaugeDone

func (m *SenderMock) MinimockGaugeDone() bool

MinimockGaugeDone returns true if the count of the Gauge invocations corresponds the number of defined expectations

func (*SenderMock) MinimockGaugeInspect

func (m *SenderMock) MinimockGaugeInspect()

MinimockGaugeInspect logs each unmet expectation

func (*SenderMock) MinimockGaugeMSDone

func (m *SenderMock) MinimockGaugeMSDone() bool

MinimockGaugeMSDone returns true if the count of the GaugeMS invocations corresponds the number of defined expectations

func (*SenderMock) MinimockGaugeMSInspect

func (m *SenderMock) MinimockGaugeMSInspect()

MinimockGaugeMSInspect logs each unmet expectation

func (*SenderMock) MinimockWait

func (m *SenderMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type SenderMockCountExpectation

type SenderMockCountExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SenderMockCountExpectation specifies expectation struct of the Sender.Count

type SenderMockCountParams

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

SenderMockCountParams contains parameters of the Sender.Count

type SenderMockGaugeExpectation

type SenderMockGaugeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SenderMockGaugeExpectation specifies expectation struct of the Sender.Gauge

type SenderMockGaugeMSExpectation

type SenderMockGaugeMSExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SenderMockGaugeMSExpectation specifies expectation struct of the Sender.GaugeMS

type SenderMockGaugeMSParams

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

SenderMockGaugeMSParams contains parameters of the Sender.GaugeMS

type SenderMockGaugeParams

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

SenderMockGaugeParams contains parameters of the Sender.Gauge

type Service

type Service string
const (
	Proxy    Service = "modprox-proxy"
	Registry Service = "modprox-registry"
)

func (Service) String

func (s Service) String() string

type Statsd

type Statsd struct {
	Agent netservice.Instance `json:"agent"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳