prom

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricLabels

func MetricLabels(m model.Metric) map[string]string

Types

type ClusterEntry

type ClusterEntry struct {
	ClusterName string
	Entries     []EntityInfo
}

func NewClusterEntry

func NewClusterEntry(name string) *ClusterEntry

type ClusterFilter

type ClusterFilter map[string]*regexp.Regexp

func (ClusterFilter) Add

func (cf ClusterFilter) Add(name string)

func (ClusterFilter) Empty

func (cf ClusterFilter) Empty() bool

func (ClusterFilter) Has

func (cf ClusterFilter) Has(name string) bool

Has return True if there are no filters, or if there is at least one filter which matches name

type ClusterResultSet

type ClusterResultSet map[string]*ClusterEntry

func (ClusterResultSet) HasDeploys

func (crs ClusterResultSet) HasDeploys() bool

HasDeploys returns true if the result set has any deployables to display

func (ClusterResultSet) HasPods

func (crs ClusterResultSet) HasPods() bool

HasPods returns true if the result set has any pods to display

func (ClusterResultSet) SortedByCluster

func (crs ClusterResultSet) SortedByCluster() []string

sortedClusters returns a sorted list of Cluster names

type ContainerInfo

type ContainerInfo struct {
	ContainerName  string
	ContainerImage string
}

type EntityInfo

type EntityInfo struct {
	Name      string
	Type      EntityType
	ChartName string
	ContainerInfo
}

func (*EntityInfo) SetChartFrom

func (e *EntityInfo) SetChartFrom(labels map[string]string)

type EntityInfoList

type EntityInfoList []EntityInfo

func (EntityInfoList) Len

func (eil EntityInfoList) Len() int

func (EntityInfoList) Less

func (eil EntityInfoList) Less(i, j int) bool

func (EntityInfoList) Swap

func (eil EntityInfoList) Swap(i, j int)

type EntityType

type EntityType string
const (
	EntityDeployment  EntityType = "Deployment"
	EntityDaemonset   EntityType = "DaemonSet"
	EntityStatefulset EntityType = "StatefulSet"
	EntityPod         EntityType = "Pod"
)

type PromClient

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

func NewClient

func NewClient(url string) *PromClient

func (*PromClient) GetInfo

func (pc *PromClient) GetInfo(ns string, filter ClusterFilter) ClusterResultSet

func (*PromClient) SetTimeout

func (pc *PromClient) SetTimeout(seconds int) *PromClient

Jump to

Keyboard shortcuts

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