Documentation ¶
Overview ¶
Package query metric query
Index ¶
- Constants
- func GetMasterNodeMatch(ctx context.Context, clusterID string) (string, string, error)
- func GetMasterNodeMatchIgnoreErr(ctx context.Context, clusterID string) (string, string, bool)
- type BCSMonitorHandler
- func (BCSMonitorHandler) ClusterCPURequestUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterCPUUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterDiskUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterDiskioUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterMemoryRequestUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterMemoryUsage(c *rest.Context) (promclient.ResultData, error)
- func (BCSMonitorHandler) ClusterPodUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BCSMonitorHandler) GetClusterOverview(c *rest.Context) (ClusterOverviewMetric, error)
- type BKMonitorHandler
- func (h BKMonitorHandler) ClusterCPURequestUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterCPUUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterDiskUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterDiskioUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterMemoryRequestUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterMemoryUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) ClusterPodUsage(c *rest.Context) (promclient.ResultData, error)
- func (h BKMonitorHandler) GetClusterOverview(c *rest.Context) (ClusterOverviewMetric, error)
- type ClusterOverviewMetric
- type Config
- type Handler
- type Usage
- type UsageByte
- type UsageQuery
Constants ¶
const (
// PROVIDER provider
PROVIDER = `provider="BCS_SYSTEM"`
)
Variables ¶
This section is empty.
Functions ¶
func GetMasterNodeMatch ¶
GetMasterNodeMatch 按集群node节点正则匹配
Types ¶
type BCSMonitorHandler ¶
type BCSMonitorHandler struct { }
BCSMonitorHandler metric handler
func NewBCSMonitorHandler ¶
func NewBCSMonitorHandler() *BCSMonitorHandler
NewBCSMonitorHandler new handler
func (BCSMonitorHandler) ClusterCPURequestUsage ¶
func (BCSMonitorHandler) ClusterCPURequestUsage(c *rest.Context) (promclient.ResultData, error)
ClusterCPURequestUsage implements Handler.
func (BCSMonitorHandler) ClusterCPUUsage ¶
func (BCSMonitorHandler) ClusterCPUUsage(c *rest.Context) (promclient.ResultData, error)
ClusterCPUUsage implements Handler.
func (BCSMonitorHandler) ClusterDiskUsage ¶
func (BCSMonitorHandler) ClusterDiskUsage(c *rest.Context) (promclient.ResultData, error)
ClusterDiskUsage implements Handler.
func (BCSMonitorHandler) ClusterDiskioUsage ¶
func (BCSMonitorHandler) ClusterDiskioUsage(c *rest.Context) (promclient.ResultData, error)
ClusterDiskioUsage implements Handler.
func (BCSMonitorHandler) ClusterMemoryRequestUsage ¶
func (BCSMonitorHandler) ClusterMemoryRequestUsage(c *rest.Context) (promclient.ResultData, error)
ClusterMemoryRequestUsage implements Handler.
func (BCSMonitorHandler) ClusterMemoryUsage ¶
func (BCSMonitorHandler) ClusterMemoryUsage(c *rest.Context) (promclient.ResultData, error)
ClusterMemoryUsage implements Handler.
func (BCSMonitorHandler) ClusterPodUsage ¶
func (BCSMonitorHandler) ClusterPodUsage(c *rest.Context) (promclient.ResultData, error)
ClusterPodUsage implements Handler.
func (BCSMonitorHandler) GetClusterOverview ¶
func (h BCSMonitorHandler) GetClusterOverview(c *rest.Context) (ClusterOverviewMetric, error)
GetClusterOverview 获取集群概览
type BKMonitorHandler ¶
type BKMonitorHandler struct {
// contains filtered or unexported fields
}
BKMonitorHandler metric handler
func NewBKMonitorHandler ¶
func NewBKMonitorHandler(bkBizID, clusterID string) *BKMonitorHandler
NewBKMonitorHandler new handler
func (BKMonitorHandler) ClusterCPURequestUsage ¶
func (h BKMonitorHandler) ClusterCPURequestUsage(c *rest.Context) (promclient.ResultData, error)
ClusterCPURequestUsage implements Handler. nolint
func (BKMonitorHandler) ClusterCPUUsage ¶
func (h BKMonitorHandler) ClusterCPUUsage(c *rest.Context) (promclient.ResultData, error)
ClusterCPUUsage implements Handler. nolint
func (BKMonitorHandler) ClusterDiskUsage ¶
func (h BKMonitorHandler) ClusterDiskUsage(c *rest.Context) (promclient.ResultData, error)
ClusterDiskUsage implements Handler. nolint
func (BKMonitorHandler) ClusterDiskioUsage ¶
func (h BKMonitorHandler) ClusterDiskioUsage(c *rest.Context) (promclient.ResultData, error)
ClusterDiskioUsage implements Handler. nolint
func (BKMonitorHandler) ClusterMemoryRequestUsage ¶
func (h BKMonitorHandler) ClusterMemoryRequestUsage(c *rest.Context) (promclient.ResultData, error)
ClusterMemoryRequestUsage implements Handler. nolint
func (BKMonitorHandler) ClusterMemoryUsage ¶
func (h BKMonitorHandler) ClusterMemoryUsage(c *rest.Context) (promclient.ResultData, error)
ClusterMemoryUsage implements Handler. nolint
func (BKMonitorHandler) ClusterPodUsage ¶
func (h BKMonitorHandler) ClusterPodUsage(c *rest.Context) (promclient.ResultData, error)
ClusterPodUsage implements Handler. nolint
func (BKMonitorHandler) GetClusterOverview ¶
func (h BKMonitorHandler) GetClusterOverview(c *rest.Context) (ClusterOverviewMetric, error)
GetClusterOverview 获取集群概览 nolint
type ClusterOverviewMetric ¶
type ClusterOverviewMetric struct { CPUUsage *Usage `json:"cpu_usage"` DiskUsage *UsageByte `json:"disk_usage"` MemoryUsage *UsageByte `json:"memory_usage"` DiskIOUsage *Usage `json:"diskio_usage"` PodUsage *Usage `json:"pod_usage"` }
ClusterOverviewMetric 集群概览接口
type Handler ¶
type Handler interface { GetClusterOverview(c *rest.Context) (ClusterOverviewMetric, error) ClusterPodUsage(c *rest.Context) (promclient.ResultData, error) ClusterCPUUsage(c *rest.Context) (promclient.ResultData, error) ClusterCPURequestUsage(c *rest.Context) (promclient.ResultData, error) ClusterMemoryUsage(c *rest.Context) (promclient.ResultData, error) ClusterMemoryRequestUsage(c *rest.Context) (promclient.ResultData, error) ClusterDiskUsage(c *rest.Context) (promclient.ResultData, error) ClusterDiskioUsage(c *rest.Context) (promclient.ResultData, error) }
Handler metric handler
type Usage ¶
type Usage struct { Used string `json:"used"` Request string `json:"request"` Total string `json:"total"` }
Usage 使用量
type UsageByte ¶
type UsageByte struct { UsedByte string `json:"used_bytes"` RequestByte string `json:"request_bytes"` TotalByte string `json:"total_bytes"` }
UsageByte 使用量, bytes单位
type UsageQuery ¶
type UsageQuery struct { StartAt string `json:"start_at" form:"start_at"` // 必填参数` EndAt string `json:"end_at" form:"end_at"` }
UsageQuery 节点查询
func (*UsageQuery) GetQueryTime ¶
func (q *UsageQuery) GetQueryTime() (*clientutil.PromQueryTime, error)
GetQueryTime 转换为 promql 查询时间