add support for additional prometheus labels for query (#1936)

This commit is contained in:
Harshavardhana
2022-05-05 13:44:10 -07:00
committed by GitHub
parent 9103ea9d70
commit 3bfdbb5ec7
109 changed files with 606 additions and 841 deletions

View File

@@ -19,17 +19,18 @@ package restapi
import (
"bytes"
"context"
"errors"
"io"
"testing"
"errors"
"github.com/minio/madmin-go"
"github.com/stretchr/testify/assert"
)
var minioStartProfiling func(profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error)
var minioStopProfiling func() (io.ReadCloser, error)
var (
minioStartProfiling func(profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error)
minioStopProfiling func() (io.ReadCloser, error)
)
// mock function of startProfiling()
func (ac adminClientMock) startProfiling(ctx context.Context, profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
@@ -69,8 +70,8 @@ func TestStartProfiling(t *testing.T) {
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
}
assert.Equal(2, len(startProfilingResults))
//Test-2 : startProfiling() Correctly handles errors returned by Minio
//mock function response from startProfiling()
// Test-2 : startProfiling() Correctly handles errors returned by Minio
// mock function response from startProfiling()
minioStartProfiling = func(profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
return nil, errors.New("error")
}