metrics

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

Metrics

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code uint32

Code is an 32-bit representation of a status state.

const (
	// Unset is the default status code.
	Unset Code = 0
	// Error indicates the operation contains an error.
	Error Code = 1
	// OK indicates operation has been validated by an Application developers
	// or Operator to have completed successfully, or contain no error.
	OK Code = 2

	// NotFound means some requested entity (e.g., file or directory) was
	// not found.
	//
	// This error code will not be generated by the gRPC framework.
	NotFound Code = 5
)

func (*Code) MarshalJSON

func (c *Code) MarshalJSON() ([]byte, error)

MarshalJSON returns c as the JSON encoding of c.

func (Code) String

func (c Code) String() string

String returns the Code as a string.

func (*Code) UnmarshalJSON

func (c *Code) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals b into the Code.

This is based on the functionality in the gRPC codes package: https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244

type Counter

type Counter interface {
	With(lvs ...string) Counter
	Inc()
	Add(delta float64)
}

Counter is metrics counter.

type Gauge

type Gauge interface {
	With(lvs ...string) Gauge
	Set(value float64)
	Add(delta float64)
	Sub(delta float64)
}

Gauge is metrics gauge.

type Observer

type Observer interface {
	With(lvs ...string) Observer
	Observe(float64)
}

Observer is metrics observer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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