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 JsonFloat
- type JudgeItem
- type MetricValue
- type NullRpcRequest
- 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" )
View Source
const GRAPH = 1
View Source
const SPLIT = "/"
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 (this *BuiltinMetric) String() string
type BuiltinMetricRequest ¶
type BuiltinMetricResponse ¶
type BuiltinMetricResponse struct { Metrics []*BuiltinMetric Checksum string Timestamp int64 ErrCode int }
func (*BuiltinMetricResponse) String ¶
func (this *BuiltinMetricResponse) String() string
type BuiltinMetricSlice ¶
type BuiltinMetricSlice []*BuiltinMetric
func (BuiltinMetricSlice) Len ¶
func (this BuiltinMetricSlice) Len() int
func (BuiltinMetricSlice) Less ¶
func (this BuiltinMetricSlice) Less(i, j int) bool
func (BuiltinMetricSlice) Swap ¶
func (this 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 IndexModel ¶
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"` }
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种格式,方便后端组件使用 }
func (*MetricValue) CheckValidity ¶
func (m *MetricValue) CheckValidity() (err error)
func (*MetricValue) PK ¶
func (m *MetricValue) PK() string
func (*MetricValue) String ¶
func (m *MetricValue) String() string
type NullRpcRequest ¶
type NullRpcRequest struct { }
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 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.