fakemonitoring

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fakemonitoring provides a fake implementation of monitoring clients and loggers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements a fake monitoring.Client

func NewClient

func NewClient(name string) *Client

NewClient creates a new fake monitoring client.

func (*Client) Events

func (c *Client) Events() []*LogEvent

Events returns logged events.

func (*Client) Failures

func (c *Client) Failures() []*LogFailure

Failures returns logged failures.

func (*Client) NewLogger

func (c *Client) NewLogger(context *monitoring.Context) (monitoring.Logger, error)

NewLogger creates a new fake Logger.

type LogEvent

type LogEvent struct {
	Context  *monitoring.Context
	KeyID    uint32
	NumBytes int
}

LogEvent stored on each 'Log' operation.

type LogFailure

type LogFailure struct {
	Context *monitoring.Context
}

LogFailure stored on each 'LogFailure' operation.

type Logger

type Logger struct {
	Context *monitoring.Context
	// contains filtered or unexported fields
}

Logger implements a fake monitoring.Logger

func (*Logger) Log

func (l *Logger) Log(keyID uint32, numBytes int)

Log logs the use of a primitive with a key with `keyID` operating over `numBytes`.

func (*Logger) LogFailure

func (l *Logger) LogFailure()

LogFailure captures a failure.

Jump to

Keyboard shortcuts

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