promecieus

package
v0.0.0-...-64758fa Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorContainerLog = errors.New("failed to start prometheus")
)

Functions

func TryLogin

func TryLogin(kubeconfigPath string) (*k8s.Clientset, *routeClient.RouteV1Client, error)

TryLogin returns k8s clientset and route client

Types

type ContainerLogError

type ContainerLogError struct {
	Header  string `json:"header"`
	Message string `json:"message"`
}

type GrafanaDatasource

type GrafanaDatasource struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	Access    string `json:"access"`
	BasicAuth bool   `json:"basicAuth"`
}

GrafanaDatasource represents a datasource to be created

type GrafanaDatasourceResponse

type GrafanaDatasourceResponse struct {
	DataSource struct {
		ID int `json:"id"`
	} `json:"datasource"`
}

GrafanaDatasourceResponse represents response from grafana

type GrafanaSettings

type GrafanaSettings struct {
	URL    string `json:"url"`
	Token  string `json:"token"`
	Cookie string `json:"cookie"`
}

GrafanaSettings stores grafana config

type OpenSockets

type OpenSockets struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type ProwInfo

type ProwInfo struct {
	Started    time.Time
	Finished   time.Time
	MetricsURL string
}

ProwInfo stores all links and data collected via scanning for metrics

type ProwJSON

type ProwJSON struct {
	Timestamp int `json:"timestamp"`
}

ProwJSON stores test start / finished timestamp

type RQuotaStatus

type RQuotaStatus struct {
	Used int64 `json:"used"`
	Hard int64 `json:"hard"`
}

RQuotaStatus stores ResourceQuota info

type ServerSettings

type ServerSettings struct {
	K8sClient   *k8s.Clientset
	RouteClient *routeClient.RouteV1Client
	Namespace   string
	RQuotaName  string
	RQStatus    *RQuotaStatus
	Conns       *OpenSockets
	Datasources map[string]int
	Grafana     *GrafanaSettings
}

ServerSettings stores info about the server

func (*ServerSettings) AddOrUpdateWS

func (s *ServerSettings) AddOrUpdateWS(conn *websocket.Conn)

func (*ServerSettings) CleanupOldDeployements

func (s *ServerSettings) CleanupOldDeployements(ctx context.Context)

CleanupOldDeployements periodically removes old deployments

func (*ServerSettings) GetResourceQuota

func (s *ServerSettings) GetResourceQuota(ctx context.Context) error

GetResourceQuota updates current resource quota setting

func (*ServerSettings) HandleStatusViaWS

func (s *ServerSettings) HandleStatusViaWS(c *gin.Context)

HandleStatusViaWS reads websocket events and runs actions

func (*ServerSettings) RemoveWS

func (s *ServerSettings) RemoveWS(conn *websocket.Conn)

func (*ServerSettings) WatchResourceQuota

func (s *ServerSettings) WatchResourceQuota(ctx context.Context)

WatchResourceQuota passes RQ updates from k8s to UI

type WSMessage

type WSMessage struct {
	Message string            `json:"message"`
	Action  string            `json:"action"`
	Data    map[string]string `json:"data,omitempty"`
}

WSMessage represents websocket message format

Jump to

Keyboard shortcuts

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