promethues

package
v0.0.0-...-9fcd7d3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	P90DurationsNode []string
	P90DurationsPod  []string
)

Functions

func GetAppSystemCpuUsagePromql

func GetAppSystemCpuUsagePromql(trace *model.Trace) string

GetAppSystemCpuUsagePromql 获取容器应用系统CPU占用

func GetAppUserCpuUsagePromql

func GetAppUserCpuUsagePromql(trace *model.Trace) string

获取容器应用用户CPU占用

func GetCpuCfsThrottledPromql

func GetCpuCfsThrottledPromql(trace *model.Trace) string

GetCpuCfsThrottledPromql 获取容器饱和度 TODO 现基于containerId模糊查询,以后基于conatinerName完全匹配

func GetCpuCfsThrottledTimeSeriesPromql

func GetCpuCfsThrottledTimeSeriesPromql(trace *model.Trace) string

func GetNodeCpuPromql

func GetNodeCpuPromql(trace *model.Trace, mode string) string

GetNodeCpuPromql 获取主机CPU使用

func GetNodeCpuSeriesPromql

func GetNodeCpuSeriesPromql(trace *model.Trace, mode string) string

func GetNodeThroughputPromql

func GetNodeThroughputPromql(trace *model.Trace) string

GetNodeThroughputPromql 获取主机节点吞吐量

func GetP90Promql

func GetP90Promql(trace *model.Trace, cpuType uint8) string

GetP90Promql 获取北极星P90数值

Types

type PrometheusClient

type PrometheusClient struct {
	// contains filtered or unexported fields
}

func NewPrometheusClient

func NewPrometheusClient(address string) (*PrometheusClient, error)

func (*PrometheusClient) QueryMetric

func (client *PrometheusClient) QueryMetric(flowId uint64, endTime uint64, query string) (float64, error)

func (*PrometheusClient) QueryP90

func (client *PrometheusClient) QueryP90(trace *model.Trace) float64

func (*PrometheusClient) QueryTimeSeriesMatrix

func (client *PrometheusClient) QueryTimeSeriesMatrix(flowId uint64, endTime uint64, step time.Duration, duration string, query string) (prometheus_model.Matrix, error)

type PromqType

type PromqType int
const (
	P90 PromqType = iota
	IntAttributeValueType
	BooleanAttributeValueType
)

Jump to

Keyboard shortcuts

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