metrictank: github.com/grafana/metrictank/schema/msg Index | Files

package msg

import "github.com/grafana/metrictank/schema/msg"

Index

Package Files

format.go format_string.go msg.go

func CreateMsg Uses

func CreateMsg(metrics []*schema.MetricData, id int64, version Format) ([]byte, error)

CreateMsg is the legacy function to create messages. It's not very fast

func ReadPointMsg Uses

func ReadPointMsg(data []byte, defaultOrg uint32) ([]byte, schema.MetricPoint, error)

func WritePointMsg Uses

func WritePointMsg(point schema.MetricPoint, buf []byte, version Format) (o []byte, err error)

WritePointMsg is like CreateMsg, except optimized for MetricPoint and buffer re-use. caller must assure a cap-len diff of at least: 33B (for FormatMetricPoint) 29B (for FormatMetricPointWithoutOrg) no other formats supported.

type Format Uses

type Format uint8
const (
    FormatMetricDataArrayJson Format = iota
    FormatMetricDataArrayMsgp
    FormatMetricPoint
    FormatMetricPointWithoutOrg
)

identifier of message format

func IsPointMsg Uses

func IsPointMsg(data []byte) (Format, bool)

func (Format) String Uses

func (i Format) String() string

type MetricData Uses

type MetricData struct {
    Id       int64
    Metrics  []*schema.MetricData
    Produced time.Time
    Format   Format
    Msg      []byte
}

func (*MetricData) DecodeMetricData Uses

func (m *MetricData) DecodeMetricData() error

sets m.Metrics to a []*schema.MetricData any subsequent call may however put different MetricData into our m.Metrics array

func (*MetricData) InitFromMsg Uses

func (m *MetricData) InitFromMsg(msg []byte) error

parses format and id (cheap), but doesn't decode metrics (expensive) just yet.

Package msg imports 8 packages (graph) and is imported by 14 packages. Updated 2019-10-06. Refresh now. Tools for package owners.