Documentation ¶
Index ¶
- Variables
- func ArchiveFromMysql(tableUnixTime int64)
- func ChangeDatabase(year string) error
- func CreateJob(dateString string)
- func InitConfig(cfg string) error
- func InitDbEngine(databaseName string) (err error)
- func InitHttpHandles()
- func InitHttpTransport() error
- func InitMonitorDbEngine() (err error)
- func InitMonitorMetricMap() error
- func ResetDbEngine()
- func StartCronJob()
- type ArchiveActionList
- type ArchiveActionParamObj
- type ArchiveCountQueryObj
- type ArchiveFiveRowObj
- type ArchiveTable
- type DefaultSortList
- type DefaultSortObj
- type GlobalConfig
- type HttpConfig
- type HttpRespJson
- type JobRecordTable
- type MonitorArchiveObj
- type MonitorConfig
- type MonitorEndpointTable
- type MonitorMetricTable
- type MonitorPromMetricTable
- type MysqlConfig
- type PrometheusArchiveTables
- type PrometheusConfig
- type PrometheusData
- type PrometheusQueryObj
- type PrometheusQueryParam
- type PrometheusResponse
- type PrometheusResult
- type TransConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultLocalTimeZone string
)
View Source
var MonitorObjList []*MonitorArchiveObj
Functions ¶
func ArchiveFromMysql ¶
func ArchiveFromMysql(tableUnixTime int64)
func ChangeDatabase ¶
func InitConfig ¶
func InitDbEngine ¶
func InitHttpHandles ¶
func InitHttpHandles()
func InitHttpTransport ¶
func InitHttpTransport() error
func InitMonitorDbEngine ¶
func InitMonitorDbEngine() (err error)
func InitMonitorMetricMap ¶
func InitMonitorMetricMap() error
func ResetDbEngine ¶ added in v1.12.3
func ResetDbEngine()
func StartCronJob ¶
func StartCronJob()
Types ¶
type ArchiveActionList ¶
type ArchiveActionList []*ArchiveActionParamObj
type ArchiveActionParamObj ¶
type ArchiveCountQueryObj ¶
type ArchiveFiveRowObj ¶
type ArchiveFiveRowObj struct { Endpoint string `json:"endpoint"` Metric string `json:"metric"` Tags string `json:"tags"` UnixTime int64 `json:"unix_time"` Avg []float64 `json:"avg"` Min []float64 `json:"min"` Max []float64 `json:"max"` P95 []float64 `json:"p_95"` Sum []float64 `json:"sum"` }
func (ArchiveFiveRowObj) CalcArchiveTable ¶
func (a ArchiveFiveRowObj) CalcArchiveTable() ArchiveTable
type ArchiveTable ¶
type ArchiveTable struct { Endpoint string `json:"endpoint"` Metric string `json:"metric"` Tags string `json:"tags"` UnixTime int64 `json:"unix_time"` Avg float64 `json:"avg"` Min float64 `json:"min"` Max float64 `json:"max"` P95 float64 `json:"p_95"` Sum float64 `json:"sum"` CreateTime string `json:"create_time"` }
type DefaultSortList ¶
type DefaultSortList []*DefaultSortObj
func (DefaultSortList) Len ¶
func (s DefaultSortList) Len() int
func (DefaultSortList) Less ¶
func (s DefaultSortList) Less(i, j int) bool
func (DefaultSortList) Swap ¶
func (s DefaultSortList) Swap(i, j int)
func (DefaultSortList) ToTagString ¶
func (s DefaultSortList) ToTagString() string
type DefaultSortObj ¶
type GlobalConfig ¶
type GlobalConfig struct { Enable string `json:"enable"` Mysql MysqlConfig `json:"mysql"` Prometheus PrometheusConfig `json:"prometheus"` Monitor MonitorConfig `json:"monitor"` Trans TransConfig `json:"trans"` Http HttpConfig `json:"http"` }
func Config ¶
func Config() *GlobalConfig
type HttpConfig ¶
type HttpRespJson ¶
type JobRecordTable ¶
type MonitorArchiveObj ¶
type MonitorArchiveObj struct { Endpoint string `json:"endpoint"` Metrics []*MonitorPromMetricTable `json:"metrics"` }
type MonitorConfig ¶
type MonitorConfig struct {
Mysql MysqlConfig `json:"mysql"`
}
type MonitorEndpointTable ¶
type MonitorMetricTable ¶
type MonitorMetricTable struct { Guid string `json:"guid" xorm:"guid"` Metric string `json:"metric" xorm:"metric"` MonitorType string `json:"monitor_type" xorm:"monitor_type"` PromExpr string `json:"prom_expr" xorm:"prom_expr"` TagOwner string `json:"tag_owner" xorm:"tag_owner"` ServiceGroup string `json:"service_group" xorm:"service_group"` Workspace string `json:"workspace" xorm:"workspace"` UpdateTime string `json:"update_time" xorm:"update_time"` }
type MonitorPromMetricTable ¶
type MysqlConfig ¶
type MysqlConfig struct { Type string `json:"type"` Server string `json:"server"` Port string `json:"port"` User string `json:"user"` Password string `json:"password"` DataBase string `json:"database"` DatabasePrefix string `json:"database_prefix"` MaxOpen int `json:"maxOpen"` MaxIdle int `json:"maxIdle"` Timeout int `json:"timeout"` }
type PrometheusArchiveTables ¶
type PrometheusArchiveTables struct {
TableName string `xorm:"TABLE_NAME"`
}
type PrometheusConfig ¶
type PrometheusData ¶
type PrometheusData struct { Result []PrometheusResult `json:"result"` ResultType string `json:"resultType"` }
type PrometheusQueryObj ¶
type PrometheusQueryObj struct { Start int64 `json:"start"` End int64 `json:"end"` Metric DefaultSortList `json:"metric"` Values [][]float64 `json:"values"` }
type PrometheusQueryParam ¶
type PrometheusQueryParam struct { Start int64 `json:"start"` End int64 `json:"end"` PromQl string `json:"prom_ql"` Data []*PrometheusQueryObj `json:"data"` }
type PrometheusResponse ¶
type PrometheusResponse struct { Status string `json:"status"` Data PrometheusData `json:"data"` }
type PrometheusResult ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.