Documentation
¶
Index ¶
- Variables
- func CreatTables(username string, password string, host string, port int, usessl bool, ...)
- func CreateDatabase(username string, password string, host string, port int, usessl bool, ...)
- func Init(key string)
- func Store(key string, value ColumnSeq)
- type Adapter
- type AdapterMetrics
- type AdapterReport
- type CheckHealth
- type ClusterBasic
- type ClusterInfo
- type ColumnSeq
- type DataDir
- type DiskInfo
- type Dnode
- type DnodeInfo
- type GeneralMetric
- type GrantInfo
- type Log
- type LogDir
- type LogInfo
- type Metric
- type MetricGroup
- type Mnode
- type NodeExporter
- type Report
- type Reporter
- type SlowSqlDetailInfo
- type StableArrayInfo
- type StableInfo
- type StbInfo
- type Summary
- type Tag
- type TempDir
- type VgroupInfo
- type Vnode
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateClusterInfoSql = "create table if not exists cluster_info (" +
"ts timestamp, " +
"first_ep binary(134), " +
"first_ep_dnode_id int, " +
"version binary(12), " +
"master_uptime float, " +
"monitor_interval int, " +
"dbs_total int, " +
"tbs_total bigint, " +
"stbs_total int, " +
"dnodes_total int, " +
"dnodes_alive int, " +
"mnodes_total int, " +
"mnodes_alive int, " +
"vgroups_total int, " +
"vgroups_alive int, " +
"vnodes_total int, " +
"vnodes_alive int, " +
"connections_total int, " +
"topics_total int, " +
"streams_total int, " +
"protocol int " +
") tags (cluster_id nchar(32))"
View Source
var CreateDataDirSql = "create table if not exists data_dir (" +
"ts timestamp, " +
"name nchar(200), " +
"`level` int, " +
"avail bigint, " +
"used bigint, " +
"total bigint" +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateDnodeInfoSql = "create table if not exists dnodes_info (" +
"ts timestamp, " +
"uptime float, " +
"cpu_engine float, " +
"cpu_system float, " +
"cpu_cores float, " +
"mem_engine int, " +
"mem_system int, " +
"mem_total int, " +
"disk_engine bigint, " +
"disk_used bigint, " +
"disk_total bigint, " +
"net_in float, " +
"net_out float, " +
"io_read float, " +
"io_write float, " +
"io_read_disk float, " +
"io_write_disk float, " +
"req_select int, " +
"req_select_rate float, " +
"req_insert int, " +
"req_insert_success int, " +
"req_insert_rate float, " +
"req_insert_batch int, " +
"req_insert_batch_success int, " +
"req_insert_batch_rate float, " +
"errors int, " +
"vnodes_num int, " +
"masters int, " +
"has_mnode int, " +
"has_qnode int, " +
"has_snode int, " +
"has_bnode int " +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateDnodeSql = "create table if not exists d_info (" +
"ts timestamp, " +
"status binary(10)" +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateGrantInfoSql = "create table if not exists grants_info(" +
"ts timestamp, " +
"expire_time bigint, " +
"timeseries_used bigint, " +
"timeseries_total bigint " +
") tags (cluster_id nchar(32))"
View Source
var CreateKeeperSql = "create table if not exists keeper_monitor (" +
"ts timestamp, " +
"cpu float, " +
"mem float, " +
"total_reports int " +
") tags (identify nchar(50))"
View Source
var CreateLogDirSql = "create table if not exists log_dir (" +
"ts timestamp, " +
"name nchar(200), " +
"avail bigint, " +
"used bigint, " +
"total bigint" +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateMnodeSql = "create table if not exists m_info (" +
"ts timestamp, " +
"role binary(10)" +
") tags (mnode_id int, mnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateSummarySql = "create table if not exists log_summary(" +
"ts timestamp, " +
"error int, " +
"info int, " +
"debug int, " +
"trace int " +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateTempDirSql = "create table if not exists temp_dir(" +
"ts timestamp, " +
"name nchar(200), " +
"avail bigint, " +
"used bigint, " +
"total bigint " +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateVgroupsInfoSql = "create table if not exists vgroups_info (" +
"ts timestamp, " +
"vgroup_id int, " +
"database_name binary(33), " +
"tables_num bigint, " +
"status binary(512) " +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var CreateVnodeRoleSql = "create table if not exists vnodes_role (" +
"ts timestamp, " +
"vnode_role binary(10) " +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"
View Source
var MAX_SQL_LEN = 1000000
View Source
var STABLE_NAME_KEY = "priv_stn"
Functions ¶
func CreatTables ¶ added in v1.0.28
func CreateDatabase ¶ added in v1.0.28
Types ¶
type Adapter ¶ added in v1.0.16
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶ added in v1.0.16
type AdapterMetrics ¶ added in v1.0.16
type AdapterMetrics struct {
RestTotal int `json:"rest_total"`
RestQuery int `json:"rest_query"`
RestWrite int `json:"rest_write"`
RestOther int `json:"rest_other"`
RestInProcess int `json:"rest_in_process"`
RestSuccess int `json:"rest_success"`
RestFail int `json:"rest_fail"`
RestQuerySuccess int `json:"rest_query_success"`
RestQueryFail int `json:"rest_query_fail"`
RestWriteSuccess int `json:"rest_write_success"`
RestWriteFail int `json:"rest_write_fail"`
RestOtherSuccess int `json:"rest_other_success"`
RestOtherFail int `json:"rest_other_fail"`
RestQueryInProcess int `json:"rest_query_in_process"`
RestWriteInProcess int `json:"rest_write_in_process"`
WSTotal int `json:"ws_total"`
WSQuery int `json:"ws_query"`
WSWrite int `json:"ws_write"`
WSOther int `json:"ws_other"`
WSInProcess int `json:"ws_in_process"`
WSSuccess int `json:"ws_success"`
WSFail int `json:"ws_fail"`
WSQuerySuccess int `json:"ws_query_success"`
WSQueryFail int `json:"ws_query_fail"`
WSWriteSuccess int `json:"ws_write_success"`
WSWriteFail int `json:"ws_write_fail"`
WSOtherSuccess int `json:"ws_other_success"`
WSOtherFail int `json:"ws_other_fail"`
WSQueryInProcess int `json:"ws_query_in_process"`
WSWriteInProcess int `json:"ws_write_in_process"`
}
type AdapterReport ¶ added in v1.0.16
type AdapterReport struct {
Timestamp int64 `json:"ts"`
Metric AdapterMetrics `json:"metrics"`
Endpoint string `json:"endpoint"`
}
type CheckHealth ¶ added in v1.0.5
type CheckHealth struct {
// contains filtered or unexported fields
}
func NewCheckHealth ¶ added in v1.0.5
func NewCheckHealth(version string) *CheckHealth
func (*CheckHealth) Init ¶ added in v1.0.5
func (h *CheckHealth) Init(c gin.IRouter)
type ClusterBasic ¶ added in v1.0.23
type ClusterInfo ¶
type ClusterInfo struct {
FirstEp string `json:"first_ep"`
FirstEpDnodeID int `json:"first_ep_dnode_id"`
Version string `json:"version"`
MasterUptime float32 `json:"master_uptime"`
MonitorInterval int `json:"monitor_interval"`
DbsTotal int `json:"dbs_total"`
TbsTotal int64 `json:"tbs_total"` // change to bigint since TS-3003
StbsTotal int `json:"stbs_total"`
VgroupsTotal int `json:"vgroups_total"`
VgroupsAlive int `json:"vgroups_alive"`
VnodesTotal int `json:"vnodes_total"`
VnodesAlive int `json:"vnodes_alive"`
ConnectionsTotal int `json:"connections_total"`
TopicsTotal int `json:"topics_total"`
StreamsTotal int `json:"streams_total"`
Dnodes []Dnode `json:"dnodes"`
Mnodes []Mnode `json:"mnodes"`
}
type ColumnSeq ¶ added in v1.0.23
type ColumnSeq struct {
// contains filtered or unexported fields
}
type DnodeInfo ¶
type DnodeInfo struct {
Uptime float32 `json:"uptime"`
CPUEngine float32 `json:"cpu_engine"`
CPUSystem float32 `json:"cpu_system"`
CPUCores float32 `json:"cpu_cores"`
MemEngine int `json:"mem_engine"`
MemSystem int `json:"mem_system"`
MemTotal int `json:"mem_total"`
DiskEngine int64 `json:"disk_engine"`
DiskUsed int64 `json:"disk_used"`
DiskTotal int64 `json:"disk_total"`
NetIn float32 `json:"net_in"`
NetOut float32 `json:"net_out"`
IoRead float32 `json:"io_read"`
IoWrite float32 `json:"io_write"`
IoReadDisk float32 `json:"io_read_disk"`
IoWriteDisk float32 `json:"io_write_disk"`
ReqSelect int `json:"req_select"`
ReqSelectRate float32 `json:"req_select_rate"`
ReqInsert int `json:"req_insert"`
ReqInsertSuccess int `json:"req_insert_success"`
ReqInsertRate float32 `json:"req_insert_rate"`
ReqInsertBatch int `json:"req_insert_batch"`
ReqInsertBatchSuccess int `json:"req_insert_batch_success"`
ReqInsertBatchRate float32 `json:"req_insert_batch_rate"`
Errors int `json:"errors"`
VnodesNum int `json:"vnodes_num"`
Masters int `json:"masters"`
HasMnode int8 `json:"has_mnode"`
HasQnode int8 `json:"has_qnode"`
HasSnode int8 `json:"has_snode"`
HasBnode int8 `json:"has_bnode"`
}
type GeneralMetric ¶ added in v1.0.23
type GeneralMetric struct {
// contains filtered or unexported fields
}
func NewGeneralMetric ¶ added in v1.0.23
func NewGeneralMetric(conf *config.Config) *GeneralMetric
type MetricGroup ¶ added in v1.0.23
type NodeExporter ¶
type NodeExporter struct {
// contains filtered or unexported fields
}
func NewNodeExporter ¶
func NewNodeExporter(processor *process.Processor) *NodeExporter
func (*NodeExporter) Init ¶
func (z *NodeExporter) Init(c gin.IRouter)
type Report ¶
type Report struct {
Ts string `json:"ts"`
DnodeID int `json:"dnode_id"`
DnodeEp string `json:"dnode_ep"`
ClusterID string `json:"cluster_id"`
Protocol int `json:"protocol"`
ClusterInfo *ClusterInfo `json:"cluster_info"` // only reported by master
StbInfos []StbInfo `json:"stb_infos"`
VgroupInfos []VgroupInfo `json:"vgroup_infos"` // only reported by master
GrantInfo *GrantInfo `json:"grant_info"` // only reported by master
DnodeInfo DnodeInfo `json:"dnode_info"`
DiskInfos DiskInfo `json:"disk_infos"`
LogInfos LogInfo `json:"log_infos"`
}
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
func NewReporter ¶
func (*Reporter) GetTotalRep ¶
type SlowSqlDetailInfo ¶ added in v1.1.10
type SlowSqlDetailInfo struct {
StartTs string `json:"start_ts"`
RequestId string `json:"request_id"`
QueryTime int32 `json:"query_time"`
Code int32 `json:"code"`
ErrorInfo string `json:"error_info"`
Type int8 `json:"type"`
RowsNum int64 `json:"rows_num"`
Sql string `json:"sql"`
ProcessName string `json:"process_name"`
ProcessId string `json:"process_id"`
Db string `json:"db"`
User string `json:"user"`
Ip string `json:"ip"`
ClusterId string `json:"cluster_id"`
}
type StableArrayInfo ¶ added in v1.0.23
type StableArrayInfo struct {
Ts string `json:"ts"`
Protocol int `json:"protocol"`
Tables []StableInfo `json:"tables"`
}
type StableInfo ¶ added in v1.0.23
type StableInfo struct {
Name string `json:"name"`
MetricGroups []MetricGroup `json:"metric_groups"`
}
type VgroupInfo ¶
Click to show internal directories.
Click to hide internal directories.