Documentation
¶
Index ¶
- Constants
- Variables
- func ToInfluxReq(req *apistructs.MetricsRequest) []*pb.QueryWithInfluxFormatRequest
- type Metric
- func (m *Metric) DoQuery(ctx context.Context, key string, req *pb.QueryWithInfluxFormatRequest) (*pb.QueryWithInfluxFormatResponse, error)
- func (m *Metric) QueryNodeResource(ctx context.Context, req *apistructs.MetricsRequest) (httpserver.Responser, error)
- func (m *Metric) QueryPodResource(ctx context.Context, req *apistructs.MetricsRequest) (httpserver.Responser, error)
- type MetricError
- type ResourceType
Constants ¶
View Source
const ( // SELECT host_ip::tag, mem_used::field FROM host_summary WHERE cluster_name::tag=$cluster_name // usage rate , distribution rate , usage percent of distribution NodeCpuUsageSelectStatement = `` /* 138-byte string literal not displayed */ NodeMemoryUsageSelectStatement = `` /* 132-byte string literal not displayed */ PodCpuUsageSelectStatement = `` /* 157-byte string literal not displayed */ PodMemoryUsageSelectStatement = `` /* 157-byte string literal not displayed */ Memory = "memory" Cpu = "cpu" Pod = "pod" Node = "node" )
Variables ¶
View Source
var NilValueError = errors.New("metrics nothing found")
Functions ¶
func ToInfluxReq ¶
func ToInfluxReq(req *apistructs.MetricsRequest) []*pb.QueryWithInfluxFormatRequest
Types ¶
type Metric ¶
type Metric struct {
Metricq pb.MetricServiceServer
}
func (*Metric) DoQuery ¶
func (m *Metric) DoQuery(ctx context.Context, key string, req *pb.QueryWithInfluxFormatRequest) (*pb.QueryWithInfluxFormatResponse, error)
DoQuery returns influxdb data
func (*Metric) QueryNodeResource ¶
func (m *Metric) QueryNodeResource(ctx context.Context, req *apistructs.MetricsRequest) (httpserver.Responser, error)
QueryNodeResource query cpu and memory metrics from es database, return immediately if cache hit.
func (*Metric) QueryPodResource ¶
func (m *Metric) QueryPodResource(ctx context.Context, req *apistructs.MetricsRequest) (httpserver.Responser, error)
type MetricError ¶
type MetricError struct {
// contains filtered or unexported fields
}
func (MetricError) Code ¶
func (m MetricError) Code() string
func (MetricError) Ctx ¶
func (m MetricError) Ctx() interface{}
func (MetricError) HttpCode ¶
func (m MetricError) HttpCode() int
func (MetricError) Render ¶
func (m MetricError) Render(locale *i18n.LocaleResource) string
type ResourceType ¶
type ResourceType string
Click to show internal directories.
Click to hide internal directories.