schema

package
v1.7.1-0...-29a0ac7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricData

type MetricData struct {
	Id         string   `json:"id"`
	OrgId      int      `json:"org_id"`
	Name       string   `json:"name"`
	Metric     string   `json:"metric"`
	Interval   int      `json:"interval"`
	Value      float64  `json:"value"`
	Unit       string   `json:"unit"`
	Time       int64    `json:"time"`
	TargetType string   `json:"target_type"`
	Tags       []string `json:"tags" elastic:"type:string,index:not_analyzed"`
}

MetricData contains all metric metadata and a datapoint

func (*MetricData) DecodeMsg

func (z *MetricData) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*MetricData) EncodeMsg

func (z *MetricData) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*MetricData) GetId

func (m *MetricData) GetId() string

returns a id (hash key) in the format OrgId.md5Sum the md5sum is a hash of the the concatination of the series name + each tag key:value pair, sorted alphabetically.

func (*MetricData) MarshalMsg

func (z *MetricData) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*MetricData) Msgsize

func (z *MetricData) Msgsize() (s int)

func (*MetricData) SetId

func (m *MetricData) SetId()

func (*MetricData) UnmarshalMsg

func (z *MetricData) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type MetricDataArray

type MetricDataArray []*MetricData

can be used by some encoders, such as msgp

func (*MetricDataArray) DecodeMsg

func (z *MetricDataArray) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (MetricDataArray) EncodeMsg

func (z MetricDataArray) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (MetricDataArray) MarshalMsg

func (z MetricDataArray) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (MetricDataArray) Msgsize

func (z MetricDataArray) Msgsize() (s int)

func (*MetricDataArray) UnmarshalMsg

func (z *MetricDataArray) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type MetricDefinition

type MetricDefinition struct {
	Id         string            `json:"id"`
	OrgId      int               `json:"org_id"`
	Name       string            `json:"name" elastic:"type:string,index:not_analyzed"`
	Metric     string            `json:"metric"`
	Interval   int               `json:"interval"` // minimum 10
	Unit       string            `json:"unit"`
	TargetType string            `json:"target_type"` // an emum ["derive","gauge"] in nodejs
	Tags       []string          `json:"tags" elastic:"type:string,index:not_analyzed"`
	LastUpdate int64             `json:"lastUpdate"` // unix epoch time, per the nodejs definition
	Nodes      map[string]string `json:"nodes"`
	NodeCount  int               `json:"node_count"`
}

for ES

func MetricDefinitionFromJSON

func MetricDefinitionFromJSON(b []byte) (*MetricDefinition, error)

func MetricDefinitionFromMetricData

func MetricDefinitionFromMetricData(d *MetricData) *MetricDefinition

func (*MetricDefinition) DecodeMsg

func (z *MetricDefinition) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*MetricDefinition) EncodeMsg

func (z *MetricDefinition) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*MetricDefinition) MarshalMsg

func (z *MetricDefinition) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*MetricDefinition) Msgsize

func (z *MetricDefinition) Msgsize() (s int)

func (*MetricDefinition) UnmarshalMsg

func (z *MetricDefinition) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*MetricDefinition) Validate

func (m *MetricDefinition) Validate() error

type ProbeEvent

type ProbeEvent struct {
	Id        string            `json:"id"`
	EventType string            `json:"event_type"`
	OrgId     int64             `json:"org_id"`
	Severity  string            `json:"severity"` // enum "INFO" "WARN" "ERROR" "OK"
	Source    string            `json:"source"`
	Timestamp int64             `json:"timestamp"`
	Message   string            `json:"message"`
	Tags      map[string]string `json:"tags"`
}

func (*ProbeEvent) DecodeMsg

func (z *ProbeEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ProbeEvent) EncodeMsg

func (z *ProbeEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ProbeEvent) MarshalMsg

func (z *ProbeEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ProbeEvent) Msgsize

func (z *ProbeEvent) Msgsize() (s int)

func (*ProbeEvent) UnmarshalMsg

func (z *ProbeEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ProbeEvent) Validate

func (e *ProbeEvent) Validate() error

Jump to

Keyboard shortcuts

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