metricsrepo

package
v0.0.0-...-b028101 Latest Latest
Warning

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

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

Documentation

Overview

TODO: This library is imported from ror, should determine if its a public library or not

Index

Constants

View Source
const (
	CollectionName = "clusters"
)
View Source
const (
	MetricsCollectionName = "metrics"
)

Variables

This section is empty.

Functions

func ForClustersByProperty

func ForClustersByProperty(ctx context.Context, property string) (*apicontracts.MetricsCustom, error)

func GetForClusterid

func GetForClusterid(ctx context.Context, clusterId string) (*apicontracts.MetricItem, error)

func GetForClusters

func GetForClusters(ctx context.Context) (*apicontracts.MetricList, error)

func GetForClustersByWorkspace

func GetForClustersByWorkspace(ctx context.Context, workspaceName string) (*apicontracts.MetricList, error)

func GetForDatacenterName

func GetForDatacenterName(ctx context.Context, datacenterName string) (*apicontracts.MetricItem, error)

func GetForDatacenters

func GetForDatacenters(ctx context.Context) (*apicontracts.MetricList, error)

func GetForWorkspaceName

func GetForWorkspaceName(ctx context.Context, workspaceName string) (*apicontracts.MetricItem, error)

func GetForWorkspacesByDatacenter

func GetForWorkspacesByDatacenter(ctx context.Context, filter *apicontracts.Filter, datacenterName string) (*apicontracts.PaginatedResult[apicontracts.Metric], error)

func GetMetricFromPrimitivM

func GetMetricFromPrimitivM(data primitive.M) apicontracts.Metrics

func GetMetricItemFromPrimitivM

func GetMetricItemFromPrimitivM(data primitive.M) apicontracts.Metric

func GetMetricsByFilter

func GetMetricsByFilter(filter apicontracts.MetricsFilter, ctx context.Context, mongodb *mongo.Database) ([]apicontracts.MetricsResult, error)

GetPodMetricsByFilter returns timeseries data filterd with the apicontracts.MetricsFilter.

  • Type must be set to either node or pod.
  • Default time is common era (year 0 - now()).
  • Default time resolution is hour. all results

func GetTotal

func GetTotal(ctx context.Context) (*apicontracts.MetricsTotal, error)

func GetTotalByUser

func GetTotalByUser(ctx context.Context) (*apicontracts.MetricsTotal, error)

func WriteMetrics

func WriteMetrics(metricsreport *apicontracts.MetricsReport, clusterId string, ctx context.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

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