perfclient

package
v0.0.0-...-a89155a Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the ClientInterface interface

func New

func New(basePath string, s gcs.GCSClient) *Client

New creates a new ClientInterface around the given GCSClient. It will use the passed-in basePath as the folder name in the bucket that GCSClient is configured for.

func (*Client) PushToPerf

func (pb *Client) PushToPerf(now time.Time, folderName, filePrefix string, data format.BenchData) error

Implements ClientInterface.PushToPerf

type ClientInterface

type ClientInterface interface {
	// PushToPerf puts data into a deterministically named folder based on the time
	// and the given folderName and filePrefix. For example, with folderName = "My-Task"
	// and filePrefix = "nanobench", and now = "2017-09-01 at 13:XX UTC", PushToPerf would put
	// data in a file like:
	// gs://my-bucket/foobar/2017/09/01/13/My-Task/nanobench_[hash]_[timestamp].json
	PushToPerf(now time.Time, folderName, filePrefix string, data format.BenchData) error
}

ClientInterface is the interface around getting data into Perf's ingestion.

type MockPerfClient

type MockPerfClient struct {
	mock.Mock
}

func NewMockPerfClient

func NewMockPerfClient() *MockPerfClient

NewMockPerfClient returns a pointer to a newly created struct. We return the pointer because we want to make sure the methods on mock.Mock stay accessible, e.g. m.On()

func (*MockPerfClient) PushToPerf

func (m *MockPerfClient) PushToPerf(now time.Time, folderName, filePrefix string, data format.BenchData) error

Jump to

Keyboard shortcuts

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