Documentation
¶
Index ¶
- Variables
- func NewLoaderContext(ctx context.Context, client ResourceUsageClient) context.Context
- func WorkloadResourceLimit(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) (*float64, error)
- func WorkloadResourceRequest(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) (float64, error)
- func WorkloadResourceUsage(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) (float64, error)
- type ApplicationInstanceUtilization
- type ResourceUsageClient
- type TeamServiceUtilization
- type TeamUtilization
- type TeamUtilizationData
- type UtilizationResourceType
- type UtilizationSample
- func WorkloadResourceLimitRange(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) ([]*UtilizationSample, error)
- func WorkloadResourceRequestRange(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) ([]*UtilizationSample, error)
- func WorkloadResourceUsageRange(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, ...) ([]*UtilizationSample, error)
- type WorkloadType
- type WorkloadUtilization
- type WorkloadUtilizationData
- type WorkloadUtilizationRecommendations
- type WorkloadUtilizationSeriesInput
Constants ¶
This section is empty.
Variables ¶
View Source
var AllUtilizationResourceType = []UtilizationResourceType{ UtilizationResourceTypeCPU, UtilizationResourceTypeMemory, }
Functions ¶
func NewLoaderContext ¶
func NewLoaderContext(ctx context.Context, client ResourceUsageClient) context.Context
func WorkloadResourceLimit ¶
func WorkloadResourceRequest ¶
Types ¶
type ApplicationInstanceUtilization ¶
type ApplicationInstanceUtilization struct { // Get the current usage for the requested resource type. Current float64 `json:"current"` }
func ForInstance ¶
func ForInstance(ctx context.Context, env string, teamSlug slug.Slug, workloadName string, instanceName string, resourceType UtilizationResourceType) (*ApplicationInstanceUtilization, error)
type ResourceUsageClient ¶
type ResourceUsageClient interface { Query(ctx context.Context, environment string, query string, opts ...promclient.QueryOption) (prom.Vector, error) QueryAll(ctx context.Context, query string, opts ...promclient.QueryOption) (map[string]prom.Vector, error) QueryRange(ctx context.Context, environment string, query string, promRange promv1.Range) (prom.Value, promv1.Warnings, error) }
type TeamServiceUtilization ¶
type TeamUtilization ¶
type TeamUtilizationData ¶
type TeamUtilizationData struct { Requested float64 `json:"requested"` Used float64 `json:"used"` EnvironmentName string `json:"-"` TeamSlug slug.Slug `json:"-"` }
func ForTeams ¶
func ForTeams(ctx context.Context, resourceType UtilizationResourceType) ([]*TeamUtilizationData, error)
type UtilizationResourceType ¶
type UtilizationResourceType string
Resource type.
const ( UtilizationResourceTypeCPU UtilizationResourceType = "CPU" UtilizationResourceTypeMemory UtilizationResourceType = "MEMORY" )
func (UtilizationResourceType) IsValid ¶
func (e UtilizationResourceType) IsValid() bool
func (UtilizationResourceType) MarshalGQL ¶
func (e UtilizationResourceType) MarshalGQL(w io.Writer)
func (UtilizationResourceType) String ¶
func (e UtilizationResourceType) String() string
func (*UtilizationResourceType) UnmarshalGQL ¶
func (e *UtilizationResourceType) UnmarshalGQL(v interface{}) error
type UtilizationSample ¶
type UtilizationSample struct { Timestamp time.Time `json:"timestamp"` Value float64 `json:"value"` Instance string `json:"instance"` }
type WorkloadType ¶
type WorkloadType int
const ( WorkloadTypeApplication WorkloadType = iota WorkloadTypeJob )
type WorkloadUtilization ¶
type WorkloadUtilization struct { EnvironmentName string `json:"-"` WorkloadName string `json:"-"` TeamSlug slug.Slug `json:"-"` WorkloadType WorkloadType `json:"-"` }
type WorkloadUtilizationData ¶
type WorkloadUtilizationData struct { Requested float64 `json:"requested"` Used float64 `json:"used"` TeamSlug slug.Slug `json:"-"` EnvironmentName string `json:"-"` WorkloadName string `json:"-"` }
func ForTeam ¶
func ForTeam(ctx context.Context, teamSlug slug.Slug, resourceType UtilizationResourceType) ([]*WorkloadUtilizationData, error)
type WorkloadUtilizationRecommendations ¶
type WorkloadUtilizationRecommendations struct { CPURequestCores float64 `json:"cpuRequest"` MemoryRequestBytes int64 `json:"memoryRequest"` MemoryLimitBytes int64 `json:"memoryLimit"` }
type WorkloadUtilizationSeriesInput ¶
type WorkloadUtilizationSeriesInput struct { Start time.Time `json:"start"` End time.Time `json:"end"` ResourceType UtilizationResourceType `json:"resourceType"` }
func (*WorkloadUtilizationSeriesInput) Step ¶
func (w *WorkloadUtilizationSeriesInput) Step() int
Click to show internal directories.
Click to hide internal directories.