Documentation ¶
Index ¶
- Constants
- func GetContainerMemoryBandwidthRequest(profilingManager ServiceProfilingManager, podMeta metav1.ObjectMeta, ...) (int, error)
- type Cache
- func (s *Cache) DeleteSPD(key string) error
- func (s *Cache) GetNextFetchRemoteTime(key string, now time.Time, skipBackoff bool) time.Time
- func (s *Cache) GetSPD(key string, updateLastGetTime bool) *workloadapis.ServiceProfileDescriptor
- func (s *Cache) ListAllSPDKeys() []string
- func (s *Cache) Run(ctx context.Context)
- func (s *Cache) SetLastFetchRemoteTime(key string, t time.Time)
- func (s *Cache) SetSPD(key string, spd *workloadapis.ServiceProfileDescriptor) error
- type DummyPodServiceProfile
- type DummySPDFetcher
- type DummyServiceProfilingManager
- func (d *DummyServiceProfilingManager) Run(_ context.Context)
- func (d *DummyServiceProfilingManager) ServiceAggregateMetrics(_ context.Context, podMeta metav1.ObjectMeta, _ v1.ResourceName, _ bool, ...) (*resource.Quantity, error)
- func (d *DummyServiceProfilingManager) ServiceBaseline(_ context.Context, _ metav1.ObjectMeta) (bool, error)
- func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceLevel(_ context.Context, podMeta metav1.ObjectMeta) (PerformanceLevel, error)
- func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceScore(_ context.Context, podMeta metav1.ObjectMeta) (float64, error)
- func (d *DummyServiceProfilingManager) ServiceExtendedIndicator(_ context.Context, _ metav1.ObjectMeta, _ interface{}) (bool, error)
- func (d *DummyServiceProfilingManager) ServiceSystemPerformanceTarget(_ context.Context, _ metav1.ObjectMeta) (IndicatorTarget, error)
- type GetPodSPDNameFunc
- type IndicatorTarget
- type PerformanceLevel
- type SPDFetcher
- type ServiceProfilingManager
Constants ¶
View Source
const ( PerformanceLevelUnknown PerformanceLevel = -1 PerformanceLevelPerfect PerformanceLevel = 0 PerformanceLevelGood PerformanceLevel = 1 PerformanceLevelPoor PerformanceLevel = 2 MaxPerformanceScore float64 = 100 MinPerformanceScore float64 = 0 )
Variables ¶
This section is empty.
Functions ¶
func GetContainerMemoryBandwidthRequest ¶ added in v0.4.1
func GetContainerMemoryBandwidthRequest(profilingManager ServiceProfilingManager, podMeta metav1.ObjectMeta, cpuRequest int) (int, error)
GetContainerMemoryBandwidthRequest gets the memory bandwidth request for pod with given cpu request
Types ¶
type Cache ¶
Cache is spd cache stores current
func NewSPDCache ¶
func NewSPDCache(manager checkpointmanager.CheckpointManager, skipCorruptionError bool, cacheTTL, expiredTime time.Duration, maxRetryCount int64, jitterFactor float64, ) (*Cache, error)
func (*Cache) GetNextFetchRemoteTime ¶ added in v0.4.0
GetNextFetchRemoteTime get next fetch remote spd timestamp
func (*Cache) GetSPD ¶
func (s *Cache) GetSPD(key string, updateLastGetTime bool) *workloadapis.ServiceProfileDescriptor
GetSPD gets target spd by namespace/name key
func (*Cache) ListAllSPDKeys ¶ added in v0.4.0
ListAllSPDKeys list all spd key
func (*Cache) SetLastFetchRemoteTime ¶
SetLastFetchRemoteTime set last fetch remote spd timestamp
func (*Cache) SetSPD ¶
func (s *Cache) SetSPD(key string, spd *workloadapis.ServiceProfileDescriptor) error
SetSPD set target spd to cache and checkpoint
type DummyPodServiceProfile ¶ added in v0.3.0
type DummyPodServiceProfile struct { PerformanceLevel PerformanceLevel Score float64 AggregatedMetric *resource.Quantity }
type DummySPDFetcher ¶ added in v0.4.1
type DummySPDFetcher struct {
SPD *workloadapis.ServiceProfileDescriptor
}
func (DummySPDFetcher) GetSPD ¶ added in v0.4.1
func (d DummySPDFetcher) GetSPD(_ context.Context, _ metav1.ObjectMeta) (*workloadapis.ServiceProfileDescriptor, error)
func (DummySPDFetcher) Run ¶ added in v0.4.1
func (d DummySPDFetcher) Run(_ context.Context)
type DummyServiceProfilingManager ¶
type DummyServiceProfilingManager struct {
// contains filtered or unexported fields
}
func NewDummyServiceProfilingManager ¶ added in v0.3.0
func NewDummyServiceProfilingManager(podProfiles map[types.UID]DummyPodServiceProfile) *DummyServiceProfilingManager
func (*DummyServiceProfilingManager) Run ¶
func (d *DummyServiceProfilingManager) Run(_ context.Context)
func (*DummyServiceProfilingManager) ServiceAggregateMetrics ¶ added in v0.4.1
func (d *DummyServiceProfilingManager) ServiceAggregateMetrics(_ context.Context, podMeta metav1.ObjectMeta, _ v1.ResourceName, _ bool, _, _, _ workloadapis.Aggregator, ) (*resource.Quantity, error)
func (*DummyServiceProfilingManager) ServiceBaseline ¶ added in v0.4.0
func (d *DummyServiceProfilingManager) ServiceBaseline(_ context.Context, _ metav1.ObjectMeta) (bool, error)
func (*DummyServiceProfilingManager) ServiceBusinessPerformanceLevel ¶
func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceLevel(_ context.Context, podMeta metav1.ObjectMeta) (PerformanceLevel, error)
func (*DummyServiceProfilingManager) ServiceBusinessPerformanceScore ¶
func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceScore(_ context.Context, podMeta metav1.ObjectMeta) (float64, error)
func (*DummyServiceProfilingManager) ServiceExtendedIndicator ¶ added in v0.4.1
func (d *DummyServiceProfilingManager) ServiceExtendedIndicator(_ context.Context, _ metav1.ObjectMeta, _ interface{}) (bool, error)
func (*DummyServiceProfilingManager) ServiceSystemPerformanceTarget ¶ added in v0.3.0
func (d *DummyServiceProfilingManager) ServiceSystemPerformanceTarget(_ context.Context, _ metav1.ObjectMeta) (IndicatorTarget, error)
type GetPodSPDNameFunc ¶
type GetPodSPDNameFunc func(_ metav1.ObjectMeta) (string, error)
type IndicatorTarget ¶ added in v0.3.0
type IndicatorTarget map[string]util.IndicatorTarget
type PerformanceLevel ¶
type PerformanceLevel int
PerformanceLevel is an enumeration type, the smaller the positive value, the better the performance
type SPDFetcher ¶
type SPDFetcher interface { // GetSPD get spd for given pod GetSPD(ctx context.Context, podMeta metav1.ObjectMeta) (*workloadapis.ServiceProfileDescriptor, error) // Run async loop to clear unused spd Run(ctx context.Context) }
func NewSPDFetcher ¶
func NewSPDFetcher(clientSet *client.GenericClientSet, emitter metrics.MetricEmitter, cncFetcher cnc.CNCFetcher, conf *pkgconfig.Configuration, ) (SPDFetcher, error)
NewSPDFetcher creates a spd manager to implement SPDFetcher
type ServiceProfilingManager ¶
type ServiceProfilingManager interface { // ServiceBusinessPerformanceLevel returns the service business performance level for the given pod ServiceBusinessPerformanceLevel(ctx context.Context, podMeta metav1.ObjectMeta) (PerformanceLevel, error) // ServiceBusinessPerformanceScore returns the service business performance score for the given pod // The score is in range [MinPerformanceScore, MaxPerformanceScore] ServiceBusinessPerformanceScore(ctx context.Context, podMeta metav1.ObjectMeta) (float64, error) // ServiceSystemPerformanceTarget returns the system performance target for the given pod ServiceSystemPerformanceTarget(ctx context.Context, podMeta metav1.ObjectMeta) (IndicatorTarget, error) // ServiceBaseline returns whether this pod is baseline ServiceBaseline(ctx context.Context, podMeta metav1.ObjectMeta) (bool, error) // ServiceExtendedIndicator load the extended indicators and return whether the pod is baseline for the extended indicators ServiceExtendedIndicator(ctx context.Context, podMeta metav1.ObjectMeta, indicators interface{}) (bool, error) // ServiceAggregateMetrics retrieves aggregated metrics from profiling data using different aggregators, // each designed for a specific level of aggregation: // - podAggregator: Aggregates metrics across different pods. // - containerAggregator: Aggregates metrics across different containers. // - metricsAggregator: Aggregates metrics across different time windows. ServiceAggregateMetrics(ctx context.Context, podMeta metav1.ObjectMeta, name v1.ResourceName, milliValue bool, podAggregator, containerAggregator, metricsAggregator workloadapis.Aggregator) (*resource.Quantity, error) // Run starts the service profiling manager Run(ctx context.Context) }
func NewServiceProfilingManager ¶
func NewServiceProfilingManager(fetcher SPDFetcher) ServiceProfilingManager
Click to show internal directories.
Click to hide internal directories.