metrics

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetInstanceMetrics gets the instance metrics by instance id.
	GetInstanceMetrics(ctx context.Context) (*InstanceMetrics, error)
}

Client is a client for manipulation of InstanceMetrics.

func NewClient

func NewClient(ctx context.Context, projectID, instanceID string, opts ...Option) (Client, error)

NewClient returns a new Client.

type FakeClient

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

FakeClient implements Client but operates fake objects for testing. This ensure thread-safety.

func NewFakeClient

func NewFakeClient(metrics *InstanceMetrics) *FakeClient

NewFakeClient returns a new *FakeClient initialized with the given fake objects.

func (*FakeClient) GetInstanceMetrics

func (c *FakeClient) GetInstanceMetrics(ctx context.Context) (*InstanceMetrics, error)

GetInstanceMetrics implements Client.

type InstanceMetrics

type InstanceMetrics struct {
	CurrentHighPriorityCPUUtilization int
}

InstanceMetrics represents metrics of Spanner instance.

type Option

type Option func(*client)

func WithClock

func WithClock(clock utilclock.Clock) Option

func WithLog

func WithLog(log logr.Logger) Option

func WithTerm

func WithTerm(term time.Duration) Option

func WithTokenSource

func WithTokenSource(ts oauth2.TokenSource) Option

Jump to

Keyboard shortcuts

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