open-falcon-hbs学习
open-falcon-hbs标签(空格分隔): go falcon 主要功能
模块结构
内存数据Map结构
type Template struct { Id int `json:"id"` Name string `json:"name"` ParentId int `json:"parentId"` ActionId int `json:"actionId"` Creator string `json:"creator"` }
type Strategy struct { Id int `json:"id"` Metric string `json:"metric"` Tags map[string]string `json:"tags"` Func string `json:"func"` // e.g. max(#3) all(#3) Operator string `json:"operator"` // e.g. < != RightValue float64 `json:"rightValue"` // critical value MaxStep int `json:"maxStep"` Priority int `json:"priority"` Note string `json:"note"` Tpl *Template `json:"tpl"` }
type Expression struct { Id int `json:"id"` Metric string `json:"metric"` Tags map[string]string `json:"tags"` Func string `json:"func"` // e.g. max(#3) all(#3) Operator string `json:"operator"` // e.g. < != RightValue float64 `json:"rightValue"` // critical value MaxStep int `json:"maxStep"` Priority int `json:"priority"` Note string `json:"note"` ActionId int `json:"actionId"` }
type Host struct { Id int Name string } DB和Cache
rows,err = DB.Query(sql) if err != nil { log.Println("ERROR:",err) return err } … defer DB.Close() for rows.Next(){ … err = rows.Scan(&id,&hostname) if err != nil { log.Println("ERROR:",err) continue } … }
RPC实现方式RPC服务可通过HTTP,TCP和JSON的方式建立Sever和Client;Hbs的RPC服务端通过JSON方式实现,可注册多个client,实现相关接口,供agent和judge调用。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |