Documentation ¶
Index ¶
- Constants
- type Cache
- func (s *Cache) DeleteSPD(key string) error
- func (s *Cache) GetLastFetchRemoteTime(key string) time.Time
- func (s *Cache) GetSPD(key string) *workloadapis.ServiceProfileDescriptor
- 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 DummyServiceProfilingManager
- func (d *DummyServiceProfilingManager) Run(_ context.Context)
- func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceLevel(_ context.Context, pod *v1.Pod) (PerformanceLevel, error)
- func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceScore(_ context.Context, pod *v1.Pod) (float64, error)
- func (d *DummyServiceProfilingManager) ServiceSystemPerformanceTarget(_ context.Context, _ *v1.Pod) (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 ¶
This section is empty.
Types ¶
type Cache ¶
Cache is spd cache stores current
func NewSPDCache ¶
func NewSPDCache(manager checkpointmanager.CheckpointManager, expiredTime time.Duration) *Cache
func (*Cache) GetLastFetchRemoteTime ¶
GetLastFetchRemoteTime get last fetch remote spd timestamp
func (*Cache) GetSPD ¶
func (s *Cache) GetSPD(key string) *workloadapis.ServiceProfileDescriptor
GetSPD gets target spd by namespace/name 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 }
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) ServiceBusinessPerformanceLevel ¶
func (d *DummyServiceProfilingManager) ServiceBusinessPerformanceLevel(_ context.Context, pod *v1.Pod) (PerformanceLevel, error)
func (*DummyServiceProfilingManager) ServiceBusinessPerformanceScore ¶
func (*DummyServiceProfilingManager) ServiceSystemPerformanceTarget ¶ added in v0.3.0
func (d *DummyServiceProfilingManager) ServiceSystemPerformanceTarget(_ context.Context, _ *v1.Pod) (IndicatorTarget, 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, pod *v1.Pod) (*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, pod *v1.Pod) (PerformanceLevel, error) // ServiceBusinessPerformanceScore returns the service business performance score for the given pod // The score is in range [MinPerformanceScore, MaxPerformanceScore] ServiceBusinessPerformanceScore(ctx context.Context, pod *v1.Pod) (float64, error) // ServiceSystemPerformanceTarget returns the system performance target for the given pod ServiceSystemPerformanceTarget(ctx context.Context, pod *v1.Pod) (IndicatorTarget, 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.