prometheus

package
v1.0.2003 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package prometheus is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	AwaitScrapeInterval(ctx context.Context)
	GetMaxMemoryByPodName(ctx context.Context, podName string) (max float64, err error)
	GetMaxCPUByPodName(ctx context.Context, podName string) (max float64, err error)
}

Client is the interface for communicating with prometheus

func NewClient

func NewClient(config *api.APIConfig) Client

NewClient creates an prometheus.Client to communicate with Prometheus

func NewLoggingClient

func NewLoggingClient(c Client) Client

NewLoggingClient returns a new instance of a logging Client.

func NewMetricsClient

func NewMetricsClient(c Client, requestCount metrics.Counter, requestLatency metrics.Histogram) Client

NewMetricsClient returns a new instance of a metrics Client.

func NewTracingClient

func NewTracingClient(c Client) Client

NewTracingClient returns a new instance of a tracing Client.

type MockClient

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

MockClient is a mock of Client interface

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance

func (*MockClient) AwaitScrapeInterval

func (m *MockClient) AwaitScrapeInterval(ctx context.Context)

AwaitScrapeInterval mocks base method

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClient) GetMaxCPUByPodName

func (m *MockClient) GetMaxCPUByPodName(ctx context.Context, podName string) (float64, error)

GetMaxCPUByPodName mocks base method

func (*MockClient) GetMaxMemoryByPodName

func (m *MockClient) GetMaxMemoryByPodName(ctx context.Context, podName string) (float64, error)

GetMaxMemoryByPodName mocks base method

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient

func (*MockClientMockRecorder) AwaitScrapeInterval

func (mr *MockClientMockRecorder) AwaitScrapeInterval(ctx interface{}) *gomock.Call

AwaitScrapeInterval indicates an expected call of AwaitScrapeInterval

func (*MockClientMockRecorder) GetMaxCPUByPodName

func (mr *MockClientMockRecorder) GetMaxCPUByPodName(ctx, podName interface{}) *gomock.Call

GetMaxCPUByPodName indicates an expected call of GetMaxCPUByPodName

func (*MockClientMockRecorder) GetMaxMemoryByPodName

func (mr *MockClientMockRecorder) GetMaxMemoryByPodName(ctx, podName interface{}) *gomock.Call

GetMaxMemoryByPodName indicates an expected call of GetMaxMemoryByPodName

type PrometheusQueryResponse

type PrometheusQueryResponse struct {
	Status string                      `json:"status"`
	Data   PrometheusQueryResponseData `json:"data"`
}

type PrometheusQueryResponseData

type PrometheusQueryResponseData struct {
	ResultType string                              `json:"resultType"`
	Result     []PrometheusQueryResponseDataResult `json:"result"`
}

PrometheusQueryResponseData is used to unmarshal the response from a prometheus query

type PrometheusQueryResponseDataResult

type PrometheusQueryResponseDataResult struct {
	Metric interface{}   `json:"metric"`
	Value  []interface{} `json:"value"`
}

PrometheusQueryResponseDataResult is used to unmarshal the response from a prometheus query

Jump to

Keyboard shortcuts

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