mocks

package
Version: v0.0.0-...-11fc026 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestClock

func NewTestClock(startTime time.Time) *testClock

Types

type FakeComboAPI

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

func NewComboAPI

func NewComboAPI(timerange api.Timerange, timeseries ...api.Timeseries) FakeComboAPI

NewComboAPI asks for a list of timeseries. Each must have a `metric` tag which is used to set their metric key. If you query a metric called `series_timeout` then the fetch will time-out.

func (FakeComboAPI) AddMetric

func (fapi FakeComboAPI) AddMetric(metric api.TaggedMetric, context metadata.Context) error

func (FakeComboAPI) AddMetrics

func (fapi FakeComboAPI) AddMetrics(metrics []api.TaggedMetric, context metadata.Context) error

func (FakeComboAPI) CheckHealthy

func (fapi FakeComboAPI) CheckHealthy() error

func (FakeComboAPI) ChooseResolution

func (fapi FakeComboAPI) ChooseResolution(requested api.Timerange, smallestResolution time.Duration) (time.Duration, error)

func (FakeComboAPI) FetchMultipleTimeseries

func (fapi FakeComboAPI) FetchMultipleTimeseries(multiRequest timeseries.FetchMultipleRequest) (api.SeriesList, error)

func (FakeComboAPI) FetchSingleTimeseries

func (fapi FakeComboAPI) FetchSingleTimeseries(request timeseries.FetchRequest) (api.Timeseries, error)

func (FakeComboAPI) GetAllMetrics

func (fapi FakeComboAPI) GetAllMetrics(context metadata.Context) ([]api.MetricKey, error)

func (FakeComboAPI) GetAllTags

func (fapi FakeComboAPI) GetAllTags(metric api.MetricKey, context metadata.Context) ([]api.TagSet, error)

func (FakeComboAPI) GetMetricsForTag

func (fapi FakeComboAPI) GetMetricsForTag(tagKey string, tagValue string, context metadata.Context) ([]api.MetricKey, error)

type FakeGraphiteConverter

type FakeGraphiteConverter struct {
	MetricMap map[util.GraphiteMetric]api.TaggedMetric
}

func (*FakeGraphiteConverter) ToGraphiteName

func (fa *FakeGraphiteConverter) ToGraphiteName(metric api.TaggedMetric) (util.GraphiteMetric, error)

func (*FakeGraphiteConverter) ToTaggedName

func (fa *FakeGraphiteConverter) ToTaggedName(metric util.GraphiteMetric) (api.TaggedMetric, error)

type FakeHTTPClient

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

func NewFakeHTTPClient

func NewFakeHTTPClient() *FakeHTTPClient

func (*FakeHTTPClient) Do

func (c *FakeHTTPClient) Do(request *http.Request) (*http.Response, error)

func (*FakeHTTPClient) Get

func (c *FakeHTTPClient) Get(url string) (*http.Response, error)

func (*FakeHTTPClient) SetResponse

func (c *FakeHTTPClient) SetResponse(url string, r Response)

type FakeMetricMetadataAPI

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

func NewFakeMetricMetadataAPI

func NewFakeMetricMetadataAPI() *FakeMetricMetadataAPI

func (*FakeMetricMetadataAPI) AddPair

func (*FakeMetricMetadataAPI) AddPairWithoutGraphite

func (fa *FakeMetricMetadataAPI) AddPairWithoutGraphite(tm api.TaggedMetric)

func (*FakeMetricMetadataAPI) CheckHealthy

func (fa *FakeMetricMetadataAPI) CheckHealthy() error

CheckHealthy checks if the FakeMetricMetadataAPI is healthy

func (*FakeMetricMetadataAPI) GetAllMetrics

func (fa *FakeMetricMetadataAPI) GetAllMetrics(context metadata.Context) ([]api.MetricKey, error)

func (*FakeMetricMetadataAPI) GetAllTags

func (fa *FakeMetricMetadataAPI) GetAllTags(metricKey api.MetricKey, context metadata.Context) ([]api.TagSet, error)

func (*FakeMetricMetadataAPI) GetMetricsForTag

func (fa *FakeMetricMetadataAPI) GetMetricsForTag(tagKey, tagValue string, context metadata.Context) ([]api.MetricKey, error)

type FakeTimeseriesStorageAPI

type FakeTimeseriesStorageAPI struct{}

func (FakeTimeseriesStorageAPI) CheckHealthy

func (f FakeTimeseriesStorageAPI) CheckHealthy() error

func (FakeTimeseriesStorageAPI) ChooseResolution

func (f FakeTimeseriesStorageAPI) ChooseResolution(requested api.Timerange, smallestResolution time.Duration) (time.Duration, error)

func (FakeTimeseriesStorageAPI) FetchMultipleTimeseries

func (f FakeTimeseriesStorageAPI) FetchMultipleTimeseries(request timeseries.FetchMultipleRequest) (api.SeriesList, error)

func (FakeTimeseriesStorageAPI) FetchSingleTimeseries

func (f FakeTimeseriesStorageAPI) FetchSingleTimeseries(request timeseries.FetchRequest) (api.Timeseries, error)

type Response

type Response struct {
	Body       string
	Delay      time.Duration
	StatusCode int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL