event

package
v0.0.0-...-557b32f Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventIncr = iota
	EventTiming
	EventAbsolute
	EventTotal
	EventGauge
	EventGaugeDelta
	EventFGauge
	EventFGaugeDelta
	EventFAbsolute
	EventPrecisionTiming
)

constant event type identifiers

Variables

This section is empty.

Functions

This section is empty.

Types

type Absolute

type Absolute struct {
	Name   string
	Values []int64
}

Absolute is a metric that is not averaged/aggregated. We keep each value distinct and then we flush them all individually.

func (Absolute) Key

func (e Absolute) Key() string

Key returns the name of this metric

func (Absolute) Payload

func (e Absolute) Payload() interface{}

Payload returns the aggregated value for this event

func (*Absolute) SetKey

func (e *Absolute) SetKey(key string)

SetKey sets the name of this metric

func (Absolute) Stats

func (e Absolute) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (Absolute) String

func (e Absolute) String() string

String returns a debug-friendly representation of this metric

func (Absolute) Type

func (e Absolute) Type() int

Type returns an integer identifier for this type of metric

func (Absolute) TypeString

func (e Absolute) TypeString() string

TypeString returns a name for this type of metric

func (*Absolute) Update

func (e *Absolute) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type Event

type Event interface {
	Stats() []string
	Type() int
	TypeString() string
	Payload() interface{}
	Update(e2 Event) error
	String() string
	Key() string
	SetKey(string)
}

Event is an interface to a generic StatsD event, used by the buffered client collator

type FAbsolute

type FAbsolute struct {
	Name   string
	Values []float64
}

FAbsolute is a metric that is not averaged/aggregated. We keep each value distinct and then we flush them all individually.

func (FAbsolute) Key

func (e FAbsolute) Key() string

Key returns the name of this metric

func (FAbsolute) Payload

func (e FAbsolute) Payload() interface{}

Payload returns the aggregated value for this event

func (*FAbsolute) SetKey

func (e *FAbsolute) SetKey(key string)

SetKey sets the name of this metric

func (FAbsolute) Stats

func (e FAbsolute) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (FAbsolute) String

func (e FAbsolute) String() string

String returns a debug-friendly representation of this metric

func (FAbsolute) Type

func (e FAbsolute) Type() int

Type returns an integer identifier for this type of metric

func (FAbsolute) TypeString

func (e FAbsolute) TypeString() string

TypeString returns a name for this type of metric

func (*FAbsolute) Update

func (e *FAbsolute) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type FGauge

type FGauge struct {
	Name  string
	Value float64
}

FGauge - Gauges are a constant data type. They are not subject to averaging, and they don’t change unless you change them. That is, once you set a gauge value, it will be a flat line on the graph until you change it again

func (FGauge) Key

func (e FGauge) Key() string

Key returns the name of this metric

func (FGauge) Payload

func (e FGauge) Payload() interface{}

Payload returns the aggregated value for this event

func (*FGauge) SetKey

func (e *FGauge) SetKey(key string)

SetKey sets the name of this metric

func (FGauge) Stats

func (e FGauge) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (FGauge) String

func (e FGauge) String() string

String returns a debug-friendly representation of this metric

func (FGauge) Type

func (e FGauge) Type() int

Type returns an integer identifier for this type of metric

func (FGauge) TypeString

func (e FGauge) TypeString() string

TypeString returns a name for this type of metric

func (*FGauge) Update

func (e *FGauge) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type FGaugeDelta

type FGaugeDelta struct {
	Name  string
	Value float64
}

FGaugeDelta - Gauges are a constant data type. They are not subject to averaging, and they don’t change unless you change them. That is, once you set a gauge value, it will be a flat line on the graph until you change it again

func (FGaugeDelta) Key

func (e FGaugeDelta) Key() string

Key returns the name of this metric

func (FGaugeDelta) Payload

func (e FGaugeDelta) Payload() interface{}

Payload returns the aggregated value for this event

func (*FGaugeDelta) SetKey

func (e *FGaugeDelta) SetKey(key string)

SetKey sets the name of this metric

func (FGaugeDelta) Stats

func (e FGaugeDelta) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (FGaugeDelta) String

func (e FGaugeDelta) String() string

String returns a debug-friendly representation of this metric

func (FGaugeDelta) Type

func (e FGaugeDelta) Type() int

Type returns an integer identifier for this type of metric

func (FGaugeDelta) TypeString

func (e FGaugeDelta) TypeString() string

TypeString returns a name for this type of metric

func (*FGaugeDelta) Update

func (e *FGaugeDelta) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type Gauge

type Gauge struct {
	Name  string
	Value int64
}

Gauge - Gauges are a constant data type. They are not subject to averaging, and they don’t change unless you change them. That is, once you set a gauge value, it will be a flat line on the graph until you change it again

func (Gauge) Key

func (e Gauge) Key() string

Key returns the name of this metric

func (Gauge) Payload

func (e Gauge) Payload() interface{}

Payload returns the aggregated value for this event

func (*Gauge) SetKey

func (e *Gauge) SetKey(key string)

SetKey sets the name of this metric

func (Gauge) Stats

func (e Gauge) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (Gauge) String

func (e Gauge) String() string

String returns a debug-friendly representation of this metric

func (Gauge) Type

func (e Gauge) Type() int

Type returns an integer identifier for this type of metric

func (Gauge) TypeString

func (e Gauge) TypeString() string

TypeString returns a name for this type of metric

func (*Gauge) Update

func (e *Gauge) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type GaugeDelta

type GaugeDelta struct {
	Name  string
	Value int64
}

GaugeDelta - Gauges are a constant data type. They are not subject to averaging, and they don’t change unless you change them. That is, once you set a gauge value, it will be a flat line on the graph until you change it again

func (GaugeDelta) Key

func (e GaugeDelta) Key() string

Key returns the name of this metric

func (GaugeDelta) Payload

func (e GaugeDelta) Payload() interface{}

Payload returns the aggregated value for this event

func (*GaugeDelta) SetKey

func (e *GaugeDelta) SetKey(key string)

SetKey sets the name of this metric

func (GaugeDelta) Stats

func (e GaugeDelta) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (GaugeDelta) String

func (e GaugeDelta) String() string

String returns a debug-friendly representation of this metric

func (GaugeDelta) Type

func (e GaugeDelta) Type() int

Type returns an integer identifier for this type of metric

func (GaugeDelta) TypeString

func (e GaugeDelta) TypeString() string

TypeString returns a name for this type of metric

func (*GaugeDelta) Update

func (e *GaugeDelta) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type Increment

type Increment struct {
	Name  string
	Value int64
}

Increment represents a metric whose value is averaged over a minute

func (Increment) Key

func (e Increment) Key() string

Key returns the name of this metric

func (Increment) Payload

func (e Increment) Payload() interface{}

Payload returns the aggregated value for this event

func (*Increment) SetKey

func (e *Increment) SetKey(key string)

SetKey sets the name of this metric

func (Increment) Stats

func (e Increment) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (Increment) String

func (e Increment) String() string

String returns a debug-friendly representation of this metric

func (Increment) Type

func (e Increment) Type() int

Type returns an integer identifier for this type of metric

func (Increment) TypeString

func (e Increment) TypeString() string

TypeString returns a name for this type of metric

func (*Increment) Update

func (e *Increment) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type PrecisionTiming

type PrecisionTiming struct {
	Name  string
	Min   time.Duration
	Max   time.Duration
	Value time.Duration
	Count int64
}

PrecisionTiming keeps min/max/avg information about a timer over a certain interval

func NewPrecisionTiming

func NewPrecisionTiming(k string, delta time.Duration) *PrecisionTiming

NewPrecisionTiming is a factory for a Timing event, setting the Count to 1 to prevent div_by_0 errors

func (PrecisionTiming) Key

func (e PrecisionTiming) Key() string

Key returns the name of this metric

func (PrecisionTiming) Payload

func (e PrecisionTiming) Payload() interface{}

Payload returns the aggregated value for this event

func (*PrecisionTiming) SetKey

func (e *PrecisionTiming) SetKey(key string)

SetKey sets the name of this metric

func (PrecisionTiming) Stats

func (e PrecisionTiming) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (PrecisionTiming) String

func (e PrecisionTiming) String() string

String returns a debug-friendly representation of this metric

func (PrecisionTiming) Type

func (e PrecisionTiming) Type() int

Type returns an integer identifier for this type of metric

func (PrecisionTiming) TypeString

func (e PrecisionTiming) TypeString() string

TypeString returns a name for this type of metric

func (*PrecisionTiming) Update

func (e *PrecisionTiming) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type Timing

type Timing struct {
	Name  string
	Min   int64
	Max   int64
	Value int64
	Count int64
}

Timing keeps min/max/avg information about a timer over a certain interval

func NewTiming

func NewTiming(k string, delta int64) *Timing

NewTiming is a factory for a Timing event, setting the Count to 1 to prevent div_by_0 errors

func (Timing) Key

func (e Timing) Key() string

Key returns the name of this metric

func (Timing) Payload

func (e Timing) Payload() interface{}

Payload returns the aggregated value for this event

func (*Timing) SetKey

func (e *Timing) SetKey(key string)

SetKey sets the name of this metric

func (Timing) Stats

func (e Timing) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (Timing) String

func (e Timing) String() string

String returns a debug-friendly representation of this metric

func (Timing) Type

func (e Timing) Type() int

Type returns an integer identifier for this type of metric

func (Timing) TypeString

func (e Timing) TypeString() string

TypeString returns a name for this type of metric

func (*Timing) Update

func (e *Timing) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

type Total

type Total struct {
	Name  string
	Value int64
}

Total represents a metric that is continously increasing, e.g. read operations since boot

func (Total) Key

func (e Total) Key() string

Key returns the name of this metric

func (Total) Payload

func (e Total) Payload() interface{}

Payload returns the aggregated value for this event

func (*Total) SetKey

func (e *Total) SetKey(key string)

SetKey sets the name of this metric

func (Total) Stats

func (e Total) Stats() []string

Stats returns an array of StatsD events as they travel over UDP

func (Total) String

func (e Total) String() string

String returns a debug-friendly representation of this metric

func (Total) Type

func (e Total) Type() int

Type returns an integer identifier for this type of metric

func (Total) TypeString

func (e Total) TypeString() string

TypeString returns a name for this type of metric

func (*Total) Update

func (e *Total) Update(e2 Event) error

Update the event with metrics coming from a new one of the same type and with the same key

Jump to

Keyboard shortcuts

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