recorder

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CQStateCsvHeader = []string{
	"name",
	"cohort",
	"class name",
	"CPU quota (mCPU)",
	"CPU used (mCPU * ms)",
	"CPU max usage (mCPU)",
	"monitor time (ms)",
}
View Source
var WLStateCsvHeader = []string{
	"id",
	"class name",
	"namespace",
	"name",
	"ms to admitted",
	"ms to finish",
	"num evictions",
}

Functions

This section is empty.

Types

type CQEvent

type CQEvent struct {
	Time      time.Time
	Name      string
	ClassName string
	Cohort    string
	UID       types.UID

	CPUReservation     int64
	CPUUsage           int64
	CPUQuota           int64
	PendingWorkloads   int32
	ReservingWorkloads int32
	AdmittedWorkloads  int32
	Active             bool
}

type CQGroupSummary

type CQGroupSummary struct {
	CPUUsed         int64     `json:"cpuUsed"`
	CPUAverageUsage int64     `json:"cpuAverageUsage"`
	NominalQuota    int64     `json:"nominalQuota"`
	FirstEventTime  time.Time `json:"firstEventTime"`
	LastEventTime   time.Time `json:"lastEventTime"`
}

func (*CQGroupSummary) AddQueueSummary

func (qgs *CQGroupSummary) AddQueueSummary(qs *CQState)

type CQState

type CQState struct {
	FirstEventTime  time.Time
	FirstActiveTime time.Time
	CPUUsed         int64
	CPUMaxUsage     int64
	LastEvent       *CQEvent
}

func (*CQState) CsvRecord

func (cqs *CQState) CsvRecord() []string

type CQStore

type CQStore map[string]*CQState

type Recorder

type Recorder struct {
	Store Store
	// contains filtered or unexported fields
}

func New

func New(maxRecording time.Duration) *Recorder

func (*Recorder) RecordCQState

func (r *Recorder) RecordCQState(cq *kueue.ClusterQueue)

func (*Recorder) RecordWorkloadState

func (r *Recorder) RecordWorkloadState(wl *kueue.Workload)

func (*Recorder) Run

func (r *Recorder) Run(ctx context.Context, genDone <-chan struct{}) error

func (*Recorder) WriteCQCsv

func (r *Recorder) WriteCQCsv(path string) (err error)

func (*Recorder) WriteSummary

func (r *Recorder) WriteSummary(path string) error

func (*Recorder) WriteWLCsv

func (r *Recorder) WriteWLCsv(path string) (err error)

type Store

type Store struct {
	CQ CQStore
	WL WLStore
}

type Summary

type Summary struct {
	ClusterQueueClasses map[string]*CQGroupSummary        `json:"clusterQueueClasses"`
	WorkloadClasses     map[string]*WorkloadsClassSummary `json:"workloadClasses"`
}

type WLEvent

type WLEvent struct {
	Time time.Time
	types.NamespacedName
	UID       types.UID
	ClassName string
	Admitted  bool
	Evicted   bool
	Finished  bool
}

type WLState

type WLState struct {
	ID int
	types.NamespacedName
	ClassName        string
	FirstEventTime   time.Time
	TimeToAdmitMs    int64
	TimeToFinishedMs int64
	EvictionCount    int32
	LastEvent        *WLEvent
}

func (*WLState) CsvRecord

func (wls *WLState) CsvRecord() []string

type WLStore

type WLStore map[types.UID]*WLState

type WorkloadsClassSummary

type WorkloadsClassSummary struct {
	Count int32 `json:"count"`

	TotalEvictions           int32 `json:"totalEvictions"`
	AverageTimeToAdmissionMs int64 `json:"averageTimeToAdmissionMs"`
	AverageTimeToFinishMs    int64 `json:"averageTimeToFinishMs"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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