version

package
v1.112.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultQueryDurationSeconds uint = 15 * 60 // 15 minutes
	DefaultGraphStepPoints      uint = 80
	DefaultMetricGraphs              = []kotsv1beta1.MetricGraph{
		{
			Title: "Disk Usage",
			Queries: []kotsv1beta1.MetricQuery{
				{
					Query:  `node_filesystem_size_bytes{fstype=~"ext4|xfs|btrfs|zfs",instance!="",job=~"node-exporter|kubernetes-service-endpoints"} - node_filesystem_avail_bytes{fstype=~"ext4|xfs|btrfs|zfs",instance!="",job=~"node-exporter|kubernetes-service-endpoints"}`,
					Legend: "Used: {{ instance }}-{{ device }}",
				},
				{
					Query:  `node_filesystem_avail_bytes{fstype=~"ext4|xfs|btrfs|zfs",instance!="",job=~"node-exporter|kubernetes-service-endpoints"}`,
					Legend: "Available: {{ instance }}-{{ device }}",
				},
			},
			YAxisFormat:   "bytes",
			YAxisTemplate: "{{ value }} bytes",
		},
		{
			Title:  "CPU Usage",
			Query:  fmt.Sprintf(`sum(rate(container_cpu_usage_seconds_total{namespace="%s",container!="POD",pod!=""}[5m])) by (pod)`, util.PodNamespace),
			Legend: "{{ pod }}",
		},
		{
			Title:       "Memory Usage",
			Query:       fmt.Sprintf(`sum(container_memory_usage_bytes{namespace="%s",container!="POD",pod!=""}) by (pod)`, util.PodNamespace),
			Legend:      "{{ pod }}",
			YAxisFormat: "bytes",
		},
	}
)

Functions

func DeployVersion

func DeployVersion(appID string, sequence int64) error

DeployVersion deploys the version for the given sequence

func ExtractArchiveToTempDirectory

func ExtractArchiveToTempDirectory(archiveFilename string) (string, error)

func GetForwardedPortsFromAppSpec

func GetForwardedPortsFromAppSpec(appID string, sequence int64) ([]types.ForwardedPort, error)

func GetGraphs added in v1.87.0

func GetGraphs(app *types.App, sequence int64, kotsStore store.Store) ([]kotsv1beta1.MetricGraph, error)

GetGraphs returns the rendered graphs for the given app. If there are no graphs or an error is encountered, the default set of graphs is returned.

func GetRealizedLinksFromAppSpec

func GetRealizedLinksFromAppSpec(appID string, sequence int64) ([]types.RealizedLink, error)

Types

type Metric

type Metric struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MetricChart

type MetricChart struct {
	Title        string   `json:"title"`
	TickFormat   string   `json:"tickFormat"`
	TickTemplate string   `json:"tickTemplate"`
	Series       []Series `json:"series"`
}

func GetMetricCharts

func GetMetricCharts(graphs []kotsv1beta1.MetricGraph, prometheusAddress string) []MetricChart

type SampleStream

type SampleStream struct {
	Metric map[string]string `json:"metric"`
	Values [][2]interface{}  `json:"values"`
}

type Series

type Series struct {
	LegendTemplate string      `json:"legendTemplate"`
	Metric         []Metric    `json:"metric"`
	Data           []ValuePair `json:"data"`
}

type ValuePair

type ValuePair struct {
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

Jump to

Keyboard shortcuts

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