Documentation ¶
Index ¶
- Variables
- func NewLoaderContext(ctx context.Context, client ResourceUsageClient) context.Context
- 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 Client
- type FakeClient
- type ResourceUsageClient
- type TeamServiceUtilization
- type TeamUtilization
- type TeamUtilizationData
- type TeamUtilizationEnvironmentDataPoint
- type UtilizationDataPoint
- type UtilizationResourceType
- type WorkloadType
- type WorkloadUtilization
- type WorkloadUtilizationData
- 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 WorkloadResourceRequest ¶
Types ¶
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
func NewFakeClient ¶
func NewFakeClient(environments []string, random *rand.Rand, nowFunc func() prom.Time) *FakeClient
type ResourceUsageClient ¶
type ResourceUsageClient interface {
// contains filtered or unexported methods
}
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 UtilizationDataPoint ¶
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 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 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.