Documentation ¶
Overview ¶
Package testingutil provides utility functions used only in tests.
Index ¶
- func CheckMetrics(t *testing.T, metrics *FakeMonitoringClient, expected map[string]int64)
- type FakeMonitoringClient
- func (c *FakeMonitoringClient) AddLatency(name string, value float64)
- func (c *FakeMonitoringClient) CounterValue(name string) int64
- func (c *FakeMonitoringClient) IncCounter(name string)
- func (c *FakeMonitoringClient) NewCounter(name, desc string)
- func (c *FakeMonitoringClient) NewLatency(name, desc string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMetrics ¶
func CheckMetrics(t *testing.T, metrics *FakeMonitoringClient, expected map[string]int64)
CheckMetrics checks whether metrics match expected.
Types ¶
type FakeMonitoringClient ¶
type FakeMonitoringClient struct {
// contains filtered or unexported fields
}
FakeMonitoringClient is a client used for local testing. Not thread-safe.
func NewFakeMonitoringClient ¶
func NewFakeMonitoringClient() *FakeMonitoringClient
NewFakeMonitoringClient creates a new FakeMonitoringClient.
func (*FakeMonitoringClient) AddLatency ¶
func (c *FakeMonitoringClient) AddLatency(name string, value float64)
AddLatency adds a latency value to a latency metric.
func (*FakeMonitoringClient) CounterValue ¶
func (c *FakeMonitoringClient) CounterValue(name string) int64
CounterValue returns the value of a counter metric.
func (*FakeMonitoringClient) IncCounter ¶
func (c *FakeMonitoringClient) IncCounter(name string)
IncCounter increment a counter metric.
func (*FakeMonitoringClient) NewCounter ¶
func (c *FakeMonitoringClient) NewCounter(name, desc string)
NewCounter creates a new counter metric.
func (*FakeMonitoringClient) NewLatency ¶
func (c *FakeMonitoringClient) NewLatency(name, desc string)
NewLatency creates a new latency metric.
Click to show internal directories.
Click to hide internal directories.