metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeUndefined = iota
	MessageTypeIncrement
	MessageTypeGauge
	MessageTypeTiming
	MessageTypeCount
	MessageTypeUnique
)

Message type

Variables

View Source
var InfluxFormat = FnkFormat(influxFormatFnk)

InfluxFormat message converter

Functions

func NewWrapper

func NewWrapper(mm metricas, format Formater) notificationcenter.Streamer

NewWrapper of metrica

Types

type FnkFormat

type FnkFormat func(msg interface{}) interface{}

func (FnkFormat) Format

func (f FnkFormat) Format(msg interface{}) interface{}

type Formater

type Formater interface {
	Format(msg interface{}) interface{}
}

Formater message converter

type Message

type Message struct {
	Name  string            `json:"name,omitempty"`
	Type  int               `json:"type,omitempty"`
	Tags  map[string]string `json:"tags,omitempty"`
	Value interface{}       `json:"value,omitempty"`
}

Message optimised for metric use

func (*Message) ValueInt

func (m *Message) ValueInt() int

ValueInt type

func (*Message) ValueString

func (m *Message) ValueString() string

ValueString type

type TypeCount

type TypeCount map[string]int

Metric types

type TypeGauge

type TypeGauge map[string]interface{}

Metric types

type TypeIncrement

type TypeIncrement []string

Metric types

type TypeTiming

type TypeTiming map[string]int

Metric types

type TypeUnique

type TypeUnique map[string]string

Metric types

Jump to

Keyboard shortcuts

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