Documentation
¶
Index ¶
- Constants
- func DictedTagstring(s string) map[string]string
- func HasReservedWords(str string) bool
- func PKWhitEndpointAndTags(endpoint, metric, tags string) string
- func PKWithCounter(endpoint, counter string) string
- func PKWithTags(metric, tags string) string
- func SortedTags(tags map[string]string) string
- func SplitTagsString(s string) (tags map[string]string, err error)
- type AlertUpgrade
- type BuiltinMetric
- type BuiltinMetricRequest
- type BuiltinMetricResponse
- type BuiltinMetricSlice
- type Event
- type Exp
- type File
- type History
- type HistoryData
- type IndexModel
- type IndexResp
- type InfluxdbItem
- type JsonFloat
- type JudgeItem
- type MetricValue
- type NullRpcRequest
- type OpenTsdbItem
- type QueryData
- type QueryDataForUI
- type QueryDataForUIResp
- type QueryDataResp
- type RRDData
- type RRDFile
- type RRDFileQuery
- type RRDFileResp
- type RRDValues
- type SimpleRpcResponse
- type Stra
- type StraData
- type Tag
- type TransferResp
- type TsdbItem
- type TsdbQueryParam
- type TsdbQueryResponse
Constants ¶
View Source
const ( GAUGE = "GAUGE" COUNTER = "COUNTER" DERIVE = "DERIVE" SPLIT = "/" )
View Source
const GRAPH = 1
Variables ¶
This section is empty.
Functions ¶
func DictedTagstring ¶
func HasReservedWords ¶
func PKWhitEndpointAndTags ¶
func PKWithCounter ¶
func PKWithTags ¶
func SortedTags ¶
Types ¶
type AlertUpgrade ¶
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 Event ¶
type Event struct {
ID string `json:"-"`
Sid int64 `json:"sid"`
EventType string `json:"event_type"` // alert/recover
Hashid uint64 `json:"hashid"` // 全局唯一 根据counter计算
Etime int64 `json:"etime"`
Endpoint string `json:"endpoint"`
History []History `json:"-"`
Detail string `json:"detail"`
Info string `json:"info"`
Value string `json:"value"`
Partition string `json:"-"`
}
Event 传递到alarm的结构体, 尽可能少的字段, 发出通知需要的信息由alarm自己补全
type HistoryData ¶
type HistoryData struct {
Timestamp int64 `json:"timestamp"`
Value JsonFloat `json:"value"`
Extra string `json:"extra"`
}
func RRDData2HistoryData ¶ added in v1.3.3
func RRDData2HistoryData(datas []*RRDData) []*HistoryData
type IndexModel ¶
type InfluxdbItem ¶ added in v1.4.0
type JudgeItem ¶
type JudgeItem struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Tags string `json:"tags"`
TagsMap map[string]string `json:"tagsMap"`
Value float64 `json:"value"`
Timestamp int64 `json:"timestamp"`
DsType string `json:"dstype"`
Step int `json:"step"`
Sid int64 `json:"sid"`
Extra string `json:"extra"`
}
func (*JudgeItem) PrimaryKey ¶
type MetricValue ¶
type MetricValue struct {
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 (*MetricValue) CheckValidity ¶
func (m *MetricValue) CheckValidity(now int64) (err error)
func (*MetricValue) PK ¶
func (m *MetricValue) PK() string
func (*MetricValue) String ¶
func (m *MetricValue) String() string
type NullRpcRequest ¶
type NullRpcRequest struct {
}
type OpenTsdbItem ¶ added in v1.4.0
type OpenTsdbItem struct {
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Value float64 `json:"value"`
Timestamp int64 `json:"timestamp"`
}
func (*OpenTsdbItem) OpenTsdbString ¶ added in v1.4.0
func (t *OpenTsdbItem) OpenTsdbString() (s string)
func (*OpenTsdbItem) String ¶ added in v1.4.0
func (t *OpenTsdbItem) String() string
type QueryData ¶
type QueryDataForUI ¶
type QueryDataForUI struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Metric string `json:"metric"`
Endpoints []string `json:"endpoints"`
Tags []string `json:"tags"`
Step int `json:"step"`
DsType string `json:"dstype"`
GroupKey []string `json:"groupKey"` //聚合维度
AggrFunc string `json:"aggrFunc"` //聚合计算
ConsolFunc string `json:"consolFunc"`
Comparisons []int64 `json:"comparisons"` //环比多少时间
}
type QueryDataForUIResp ¶ added in v1.0.2
type QueryDataResp ¶
type QueryDataResp struct {
Data []*TsdbQueryResponse
Msg string
}
type RRDData ¶
func HistoryData2RRDData ¶ added in v1.4.0
func HistoryData2RRDData(datas []*HistoryData) []*RRDData
func NewRRDData ¶
type RRDFileQuery ¶
type RRDFileQuery struct {
Files []RRDFile
}
type RRDFileResp ¶
type SimpleRpcResponse ¶
type SimpleRpcResponse struct {
Code int `json:"code"`
}
code == 0 => success code == 1 => bad request
type Stra ¶
type Stra struct {
ID int64 `json:"id"`
Name string `json:"name"`
Category int `json:"category"`
Nid int64 `json:"nid"`
AlertDur int `json:"alert_dur"`
RecoveryDur int `json:"recovery_dur"`
EnableStime string `json:"enable_stime"`
EnableEtime string `json:"enable_etime"`
Priority int `json:"priority"`
Callback string `json:"callback"`
Creator string `json:"creator"`
Created string `json:"created"`
LastUpdator string `json:"last_updator"`
LastUpdated string `json:"last_updated"`
ExclNid []int64 `json:"excl_nid"`
Exprs []Exp `json:"exprs"`
Tags []Tag `json:"tags"`
EnableDaysOfWeek []int `json:"enable_days_of_week"`
Converge []int `json:"converge"`
RecoveryNotify int `json:"recovery_notify"`
NotifyGroup []int64 `json:"notify_group"`
NotifyUser []int64 `json:"notify_user"`
LeafNids interface{} `json:"leaf_nids"`
NeedUpgrade int `json:"need_upgrade"`
AlertUpgrade AlertUpgrade `json:"alert_upgrade"`
}
type TransferResp ¶
func (*TransferResp) String ¶
func (t *TransferResp) String() string
type TsdbItem ¶
type TsdbItem struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Tags string `json:"tags"`
TagsMap map[string]string `json:"tagsMap"`
Value float64 `json:"value"`
Timestamp int64 `json:"timestamp"`
DsType string `json:"dstype"`
Step int `json:"step"`
Heartbeat int `json:"heartbeat"`
Min string `json:"min"`
Max string `json:"max"`
From int `json:"from"`
}
func (*TsdbItem) PrimaryKey ¶
type TsdbQueryParam ¶
type TsdbQueryParam struct {
Start int64 `json:"start"`
End int64 `json:"end"`
ConsolFunc string `json:"consolFunc"`
Endpoint string `json:"endpoint"`
Counter string `json:"counter"`
Step int `json:"step"`
DsType string `json:"dsType"`
}
ConsolFunc 是RRD中的概念,比如:MIN|MAX|AVERAGE
func (*TsdbQueryParam) PK ¶
func (g *TsdbQueryParam) PK() string
type TsdbQueryResponse ¶
type TsdbQueryResponse struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Endpoint string `json:"endpoint"`
Counter string `json:"counter"`
DsType string `json:"dstype"`
Step int `json:"step"`
Values []*RRDData `json:"values"`
}
func (*TsdbQueryResponse) Key ¶
func (resp *TsdbQueryResponse) Key() string
Click to show internal directories.
Click to hide internal directories.