Skip to content

Commit

Permalink
fix: update Observatorium API mock to comply with prometheus v1 API i…
Browse files Browse the repository at this point in the history
…nterface
  • Loading branch information
miguelsorianod committed Aug 29, 2022
1 parent c942877 commit d04ebf0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/client/observatorium/api_mock.go
Expand Up @@ -17,6 +17,8 @@ func (c *Client) MockAPI() pV1.API {
type httpAPIMock struct {
}

var _ pV1.API = &httpAPIMock{}

func (t *httpAPIMock) WalReplay(ctx context.Context) (pV1.WalReplayStatus, error) {
return pV1.WalReplayStatus{}, fmt.Errorf("not implemented")
}
Expand All @@ -26,13 +28,13 @@ func (t *httpAPIMock) QueryExemplars(ctx context.Context, query string, startTim
}

// performs a query for the kafka metrics.
func (t *httpAPIMock) Query(ctx context.Context, query string, ts time.Time) (pModel.Value, pV1.Warnings, error) {
func (t *httpAPIMock) Query(ctx context.Context, query string, ts time.Time, opts ...pV1.Option) (pModel.Value, pV1.Warnings, error) {
values := getMockQueryData(query)
return values, []string{}, nil
}

//QueryRange(ctx context.Context, query string, r pV1.Range) (pModel.Value, pV1.Warnings, error) Performs a query range for the kafka metrics
func (*httpAPIMock) QueryRange(ctx context.Context, query string, r pV1.Range) (pModel.Value, pV1.Warnings, error) {
func (*httpAPIMock) QueryRange(ctx context.Context, query string, r pV1.Range, opts ...pV1.Option) (pModel.Value, pV1.Warnings, error) {
values := getMockQueryRangeData(query)
return values, []string{}, nil
}
Expand Down

0 comments on commit d04ebf0

Please sign in to comment.