metrics

package
v1.3.0-rc Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

Types

type Metric

type Metric struct {
	Metricq pb.MetricServiceServer
}

func (*Metric) DoQuery

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

Jump to

Keyboard shortcuts

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