metrics

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

Package metrics provides a library to post status metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Value bool

	Data *MetricData
	// contains filtered or unexported fields
}

Bool implements a Bool-type metric.

func NewBool

func NewBool(name, service string) (*Bool, error)

NewBool sets the metric to a new Bool value.

func (*Bool) Set

func (b *Bool) Set(value bool) error

Set sets the metric to a new bool value.

type Int

type Int struct {
	Value int64

	Data *MetricData
	// contains filtered or unexported fields
}

Int implements a Int-type metric.

func NewCounter

func NewCounter(name, service string) (*Int, error)

NewCounter sets the metric to a new Int value.

func NewInt

func NewInt(name, service string) (*Int, error)

NewInt sets the metric to a new Int value.

func (*Int) Increment

func (i *Int) Increment() error

Increment adds to the current int metric value.

func (*Int) Set

func (i *Int) Set(value int64) error

Set sets the metric to a new int value.

type MetricData added in v1.0.2

type MetricData struct {
	Name string

	Fields map[string]interface{}
	// contains filtered or unexported fields
}

MetricData stores metric information.

func (*MetricData) AddBoolField added in v1.0.3

func (m *MetricData) AddBoolField(name string, value bool)

AddBoolField adds a bool field to a metric.

func (*MetricData) AddStringField added in v1.0.3

func (m *MetricData) AddStringField(name, value string)

AddStringField adds a string field to a metric.

type String

type String struct {
	Value string

	Data *MetricData
	// contains filtered or unexported fields
}

String implements a String-type metric.

func NewString

func NewString(name, service string) (*String, error)

NewString sets the metric to a new string value.

func (*String) Set

func (s *String) Set(value string) error

Set sets the metric to a new string value.

Jump to

Keyboard shortcuts

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