version

package
v1.33.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 25 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:  `sum((node_filesystem_size_bytes{job="node-exporter",fstype!="",instance!=""} - node_filesystem_avail_bytes{job="node-exporter", fstype!=""})) by (instance)`,
					Legend: "Used: {{ instance }}",
				},
				{
					Query:  `sum((node_filesystem_avail_bytes{job="node-exporter",fstype!="",instance!=""})) by (instance)`,
					Legend: "Available: {{ instance }}",
				},
			},
			YAxisFormat:   "bytes",
			YAxisTemplate: "{{ value }} bytes",
		},
		{
			Title:  "CPU Usage",
			Query:  `sum(rate(container_cpu_usage_seconds_total{namespace="default",container!="POD",pod!=""}[5m])) by (pod)`,
			Legend: "{{ pod }}",
		},
		{
			Title:       "Memory Usage",
			Query:       `sum(container_memory_usage_bytes{namespace="default",container!="POD",pod!=""}) by (pod)`,
			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 GetNextAppSequence added in v1.31.0

func GetNextAppSequence(appID string, currentSequence *int64) (int64, error)

GetNextAppSequence determines next available sequence for this app we shouldn't assume that a.CurrentSequence is accurate. Returns 0 if currentSequence is nil

func GetRealizedLinksFromAppSpec

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

func GetVersions added in v1.31.0

func GetVersions(appID string) ([]types.AppVersion, error)

return the list of versions available for an app

Types

type DownstreamGitOps

type DownstreamGitOps struct {
}

func (*DownstreamGitOps) CreateGitOpsDownstreamCommit

func (d *DownstreamGitOps) CreateGitOpsDownstreamCommit(appID string, clusterID string, newSequence int, filesInDir string, downstreamName string) (string, error)

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(appID string, sequence int64, prometheusAddress string) ([]MetricChart, error)

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