g

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION         = "20220419"
	TREND_INTERVALS = 3600 //聚合区间为1小时
)

Variables

View Source
var (
	Logger *log.Logger
	Ipaddr string
)
View Source
var (
	ConfigFile string
)

Functions

func InitLog

func InitLog() *log.Logger

func ParseConfig

func ParseConfig(cfg string)

Types

type DBConfig

type DBConfig struct {
	Dsn           string `json:"dsn"`
	Batch         int    `json:"batch"`
	BatchInterval int    `json:"batchInterval"`
	Concurrent    int    `json:"concurrent"`
	MaxIdle       int    `json:"maxIdle"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug        bool         `json:"debug"`
	DBLog        bool         `json:"dblog"`
	LogLevel     string       `json:"log_level"`
	LogMaxAge    int          `json:"logmaxage"`
	LogRotateAge int          `json:"logrotateage"`
	LogFile      string       `json:"logfile"`
	MetricPort   string       `json:"metricport"`
	Gauge        bool         `json:"gauge"`
	Http         *HttpConfig  `json:"http"`
	Rpc          *RpcConfig   `json:"rpc"`
	DB           *DBConfig    `json:"db"`
	Redis        *RedisConfig `json:"redis"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type RedisConfig

type RedisConfig struct {
	MaxIdle     int    `json:"maxidle"`
	MaxActive   int    `json:"maxactive"`
	IdleTimeOut int    `json:"idletimeout"`
	Server      string `json:"server"`
	Port        string `json:"port"`
}

type RpcConfig

type RpcConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type TrendResult

type TrendResult struct {
	Endpoint string
	Metric   string
	Tags     string
	DsType   string
	Step     int
	Max      float64
	Min      float64
	Avg      float64
	Num      int
}

func (*TrendResult) String

func (t *TrendResult) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL