metrics

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPSecEnabled

func IPSecEnabled(conn PromConnect, start time.Time, end time.Time) (bool, error)

IPSecEnabled checks if IPsec

func NodeMTU

func NodeMTU(conn PromConnect) (int, error)

NodeMTU return mtu

func OCPversion

func OCPversion(conn PromConnect, start time.Time, end time.Time) string

OCPversion returns the Cluster version

func Platform

func Platform(conn PromConnect) string

Platform returns the platform

func PromCheck

func PromCheck(conn PromConnect) bool

PromCheck will do a simple query, discard the results

Types

type Details

type Details struct {
	Metric struct {
		Kernel  string `json:"kernel_version"`
		Kubelet string `json:"kubelet_version"`
	}
}

Details stores the node details

func NodeDetails

func NodeDetails(conn PromConnect) Details

NodeDetails returns the Details of the nodes. Only returning a single node info.

type NodeCPU

type NodeCPU struct {
	Idle    float64 `json:"idleCPU"`
	User    float64 `json:"userCPU"`
	Steal   float64 `json:"stealCPU"`
	System  float64 `json:"systemCPU"`
	Nice    float64 `json:"niceCPU"`
	Irq     float64 `json:"irqCPU"`
	Softirq float64 `json:"softCPU"`
	Iowait  float64 `json:"ioCPU"`
}

NodeCPU stores CPU information for a specific Node

func QueryNodeCPU

func QueryNodeCPU(node NodeInfo, conn PromConnect, start time.Time, end time.Time) (NodeCPU, bool)

QueryNodeCPU will return all the CPU usage information for a given node

type NodeInfo

type NodeInfo struct {
	IP       string
	Hostname string
}

NodeInfo stores the node metadata like IP and Hostname

type PodCPU

type PodCPU struct {
	Name  string  `json:"podName"`
	Value float64 `json:"cpuUsage"`
}

PodCPU stores pod CPU

type PodValues

type PodValues struct {
	Results []PodCPU
}

PodValues is a collection of PodCPU

func TopPodCPU

func TopPodCPU(node NodeInfo, conn PromConnect, start time.Time, end time.Time) (PodValues, bool)

TopPodCPU will return the top 5 CPU consumers for a specific node

type PromConnect

type PromConnect struct {
	URL       string
	Token     string
	Verify    bool
	OpenShift bool
}

PromConnect stores the prom information

func Discover

func Discover() (PromConnect, bool)

Discover is to find Prometheus and generate an auth token if necessary.

Jump to

Keyboard shortcuts

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