Documentation
¶
Index ¶
- Constants
- func DictedTagstring(s string) map[string]string
- func GetCounter(metric, tag string, tagMap map[string]string) (counter string, err error)
- func HasReservedWords(str string) bool
- func InitRpcClients()
- func NidToEndpoint(nid string) string
- func PKWhitEndpointAndTags(endpoint, metric, tags string) string
- func PKWithCounter(endpoint, counter string) string
- func PKWithTags(metric, tags string) string
- func Push(metricItems []*MetricValue) error
- func SortedTags(tags map[string]string) string
- func SplitTagsString(s string) (tags map[string]string, err error)
- type BuiltinMetric
- type BuiltinMetricRequest
- type BuiltinMetricResponse
- type BuiltinMetricSlice
- type MetricValue
- type NullRpcRequest
- type RpcClientContainer
- type SimpleRpcResponse
- type TransferResp
Constants ¶
View Source
const ( GAUGE = "GAUGE" COUNTER = "COUNTER" SUBTRACT = "SUBTRACT" DERIVE = "DERIVE" SPLIT = "/" )
View Source
const ( MachineDep = 1 MachineIndep = 2 )
Variables ¶
This section is empty.
Functions ¶
func DictedTagstring ¶
func GetCounter ¶
func HasReservedWords ¶
func InitRpcClients ¶
func InitRpcClients()
func NidToEndpoint ¶
func PKWhitEndpointAndTags ¶
func PKWithCounter ¶
func PKWithTags ¶
func Push ¶
func Push(metricItems []*MetricValue) error
func SortedTags ¶
Types ¶
type BuiltinMetric ¶
e.g. tcp.port.listen or proc.num
func (*BuiltinMetric) String ¶
func (bm *BuiltinMetric) String() string
type BuiltinMetricRequest ¶
type BuiltinMetricResponse ¶
type BuiltinMetricResponse struct { Metrics []*BuiltinMetric Checksum string Timestamp int64 ErrCode int }
func (*BuiltinMetricResponse) String ¶
func (br *BuiltinMetricResponse) String() string
type BuiltinMetricSlice ¶
type BuiltinMetricSlice []*BuiltinMetric
func (BuiltinMetricSlice) Len ¶
func (bm BuiltinMetricSlice) Len() int
func (BuiltinMetricSlice) Less ¶
func (bm BuiltinMetricSlice) Less(i, j int) bool
func (BuiltinMetricSlice) Swap ¶
func (bm BuiltinMetricSlice) Swap(i, j int)
type MetricValue ¶
type MetricValue struct { Nid string `json:"nid"` Metric string `json:"metric"` Endpoint string `json:"endpoint"` Timestamp int64 `json:"timestamp"` Step int64 `json:"step"` ValueUntyped interface{} `json:"value"` Value float64 `json:"-"` CounterType string `json:"counterType"` Tags string `json:"tags"` TagsMap map[string]string `json:"tagsMap"` //保留2种格式,方便后端组件使用 Extra string `json:"extra"` }
func CounterValue ¶
func CounterValue(endpoint, metric string, val interface{}, tags map[string]string) *MetricValue
CounterValue Gauge type
func GaugeValue ¶
func GaugeValue(endpoint, metric string, val interface{}, tags map[string]string) *MetricValue
GaugeValue Gauge type
func NewMetricValue ¶
func NewMetricValue(endpoint, metric string, val interface{}, dataType string, tags map[string]string) *MetricValue
NewMetricValue decorate metric object,return new metric with tags
func (*MetricValue) CheckValidity ¶
func (m *MetricValue) CheckValidity(now int64) (err error)
func (*MetricValue) PK ¶
func (m *MetricValue) PK() string
type NullRpcRequest ¶
type NullRpcRequest struct { }
type RpcClientContainer ¶
func (*RpcClientContainer) Del ¶
func (rcc *RpcClientContainer) Del(addr string)
type SimpleRpcResponse ¶
type SimpleRpcResponse struct {
Code int `json:"code"`
}
code == 0 => success code == 1 => bad request
type TransferResp ¶
func (*TransferResp) String ¶
func (t *TransferResp) String() string
Click to show internal directories.
Click to hide internal directories.