core

package
v0.0.0-...-30f5ca6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID ValueType = iota
	BOOL
	INT32
	INT64
	UINT32
	UINT64
	FLOAT32
	FLOAT64
	STRING
	BYTES

	INSERT MutatorOp = iota
	UPDATE
	UPSERT
	DELETE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMeasure

type BaseMeasure interface {
	Name() string
	Description() string
	Unit() unit.Unit

	DefinitionID() EventID
}

type EventID

type EventID uint64

func (EventID) Scope

func (e EventID) Scope() ScopeID

type Key

type Key interface {
	BaseMeasure

	Value(ctx context.Context) KeyValue

	Bool(v bool) KeyValue

	Int(v int) KeyValue
	Int32(v int32) KeyValue
	Int64(v int64) KeyValue

	Uint(v uint) KeyValue
	Uint32(v uint32) KeyValue
	Uint64(v uint64) KeyValue

	Float32(v float32) KeyValue
	Float64(v float64) KeyValue

	String(v string) KeyValue
	Bytes(v []byte) KeyValue
}

type KeyValue

type KeyValue struct {
	Key   Key
	Value Value
}

type Measure

type Measure interface {
	BaseMeasure

	M(float64) Measurement
	V(float64) KeyValue
}

type MeasureMetadata

type MeasureMetadata struct {
	MaxHops int // -1 == infinite, 0 == do not propagate

}

type Measurement

type Measurement struct {
	// NOTE: If we add a ScopeID field this can carry
	// pre-aggregated measures via the stats.Record API.
	Measure Measure
	Value   float64
	ScopeID ScopeID
}

func (Measurement) With

func (m Measurement) With(id ScopeID) Measurement

type Mutator

type Mutator struct {
	MutatorOp
	KeyValue
	MeasureMetadata
}

func (Mutator) WithMaxHops

func (m Mutator) WithMaxHops(hops int) Mutator

type MutatorOp

type MutatorOp int

type ScopeID

type ScopeID struct {
	EventID
	SpanContext
}

type SpanContext

type SpanContext struct {
	TraceIDHigh uint64
	TraceIDLow  uint64
	SpanID      uint64
}

func (SpanContext) HasSpanID

func (sc SpanContext) HasSpanID() bool

func (SpanContext) HasTraceID

func (sc SpanContext) HasTraceID() bool

func (SpanContext) Scope

func (s SpanContext) Scope() ScopeID

func (SpanContext) SpanIDString

func (sc SpanContext) SpanIDString() string

func (SpanContext) TraceIDString

func (sc SpanContext) TraceIDString() string

type Value

type Value struct {
	Type    ValueType
	Bool    bool
	Int64   int64
	Uint64  uint64
	Float64 float64
	String  string
	Bytes   []byte
}

func (Value) Emit

func (v Value) Emit() string

TODO make this a lazy one-time conversion.

type ValueType

type ValueType int

Jump to

Keyboard shortcuts

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