Documentation ¶
Index ¶
- Constants
- Variables
- func FormRrdCacheKey(md5 string, dsType string, step int) string
- func GetDbConn(connName string) (c *sql.DB, e error)
- func InitDB()
- func InitLog(level string) (err error)
- func IsRrdFileExist(filename string) bool
- func IsValidString(str string) bool
- func ParseConfig(cfg string)
- func RrdFileName(baseDir string, md5 string, dsType string, step int) string
- func SplitRrdCacheKey(ckey string) (md5 string, dsType string, step int, err error)
- type DBConfig
- type File
- type GlobalConfig
- type HttpConfig
- type RRDConfig
- type RpcConfig
Constants ¶
View Source
const ( VERSION = "0.5.11" GAUGE = "GAUGE" DERIVE = "DERIVE" COUNTER = "COUNTER" DEFAULT_STEP = 60 //s MIN_STEP = 30 //s CLEAN_CACHE = 86400 //s the step that clean GraphItems/historyCache Cache CACHE_DELAY = 1800 //s CACHE_TIME = 1800000 //ms //modified by vincent.zhang for cache 15 minutes data //CACHE_DELAY = 900 //s //CACHE_TIME = 900000 //ms FLUSH_DISK_STEP = 1000 //ms FLUSH_MIN_COUNT = 6 // flush counter to disk when its number of monitoring data greater than FLUSH_MIN_COUNT FLUSH_MAX_WAIT = 86400 //s flush counter to disk if it not be flushed within FLUSH_MAX_WAIT seconds )
CHANGE LOGS 0.4.8 fix filename bug emporarily, fix dirty-index-cache bug of query,
add filter for debug
0.4.9 mv db back to g, add rpc.last 0.5.0 rm trace, add history&last api 0.5.1 add http interface v2, using form args 0.5.2 add last_raw 0.5.3 fix bug of last&last_raw 0.5.4 fix bug of Query.merge 0.5.5 use commom(rm model), fix sync disk 0.5.7 set xff to 0 from 0.5, in order to support irregular step counter 0.5.8 clean GraphItems/historyCache Cache at regular intervals 0.5.9 add flush style(flush by number of every counter's monitoring data) 0.5.11 fix bug of updateAll
View Source
const ( GRAPH_F_MISS uint32 = 1 << iota GRAPH_F_ERR GRAPH_F_SENDING GRAPH_F_FETCHING )
View Source
const (
COMMIT = "gitversion"
)
Variables ¶
View Source
var (
ConfigFile string
)
View Source
var DB *sql.DB
Functions ¶
func FormRrdCacheKey ¶
生成rrd缓存数据的key
func ParseConfig ¶
func ParseConfig(cfg string)
func RrdFileName ¶
RRDTOOL UTILS 监控数据对应的rrd文件名称
Types ¶
type GlobalConfig ¶
type GlobalConfig struct { FlustInterval int `json:"flushinterval"` Pid string `json:"pid"` Debug bool `json:"debug"` Http *HttpConfig `json:"http"` Rpc *RpcConfig `json:"rpc"` RRD *RRDConfig `json:"rrd"` DB *DBConfig `json:"db"` CallTimeout int32 `json:"callTimeout"` Migrate struct { Concurrency int `json:"concurrency"` //number of multiple worker per node Enabled bool `json:"enabled"` Replicas int `json:"replicas"` Cluster map[string]string `json:"cluster"` } `json:"migrate"` }
func Config ¶
func Config() *GlobalConfig
type HttpConfig ¶
Click to show internal directories.
Click to hide internal directories.