Versions in this module Expand all Collapse all v0 v0.1.0 Mar 12, 2021 Changes in this version + const ContainerHeartBeatReportInterval + const DefaultAotSize + const DefaultReadMfSize + const DefaultWriteMfSize + const ResourceHeartBeatReportInterval + var Denoising = true + func NewContainerStatisticsMap(opt *config.PersistOptions) *containerStatisticsMap + type ContainerHotPeersInfos struct + AsLeader ContainerHotPeersStat + AsPeer ContainerHotPeersStat + func (info *ContainerHotPeersInfos) GetContainerStatAsLeader(containerID uint64) (string, *HotPeersStat) + func (info *ContainerHotPeersInfos) GetContainerStatAsPeer(containerID uint64) (string, *HotPeersStat) + type ContainerHotPeersStat map[uint64]*HotPeersStat + type ContainerStatInformer interface + GetContainersStats func() *ContainersStats + type ContainersStats struct + func NewContainersStats() *ContainersStats + func (s *ContainersStats) FilterUnhealthyContainer(cluster core.ContainerSetInformer) + func (s *ContainersStats) GetContainerBytesRate(containerID uint64) (writeRate float64, readRate float64) + func (s *ContainersStats) GetContainerBytesReadRate(containerID uint64) float64 + func (s *ContainersStats) GetContainerBytesWriteRate(containerID uint64) float64 + func (s *ContainersStats) GetContainerCPUUsage(containerID uint64) float64 + func (s *ContainersStats) GetContainerDiskReadRate(containerID uint64) float64 + func (s *ContainersStats) GetContainerDiskWriteRate(containerID uint64) float64 + func (s *ContainersStats) GetContainersBytesReadStat() map[uint64]float64 + func (s *ContainersStats) GetContainersBytesWriteStat() map[uint64]float64 + func (s *ContainersStats) GetContainersCPUUsage(cluster core.ContainerSetInformer) map[uint64]float64 + func (s *ContainersStats) GetContainersDiskReadRate() map[uint64]float64 + func (s *ContainersStats) GetContainersDiskWriteRate() map[uint64]float64 + func (s *ContainersStats) GetContainersKeysReadStat() map[uint64]float64 + func (s *ContainersStats) GetContainersKeysWriteStat() map[uint64]float64 + func (s *ContainersStats) GetOrCreateRollingContainerStats(containerID uint64) *RollingContainerStats + func (s *ContainersStats) GetRollingContainerStats(containerID uint64) *RollingContainerStats + func (s *ContainersStats) Observe(containerID uint64, stats *rpcpb.ContainerStats) + func (s *ContainersStats) RemoveRollingContainerStats(ContainerID uint64) + func (s *ContainersStats) Set(containerID uint64, stats *rpcpb.ContainerStats) + func (s *ContainersStats) TotalBytesReadRate() float64 + func (s *ContainersStats) TotalBytesWriteRate() float64 + func (s *ContainersStats) TotalKeysReadRate() float64 + func (s *ContainersStats) TotalKeysWriteRate() float64 + func (s *ContainersStats) UpdateContainerHeartbeatMetrics(container *core.CachedContainer) + func (s *ContainersStats) UpdateTotalBytesRate(f func() []*core.CachedContainer) + func (s *ContainersStats) UpdateTotalKeysRate(f func() []*core.CachedContainer) + type FlowKind uint32 + const ReadFlow + const WriteFlow + func (k FlowKind) String() string + type HotCache struct + func NewHotCache() *HotCache + func (w *HotCache) CheckRead(res *core.CachedResource) []*HotPeerStat + func (w *HotCache) CheckWrite(res *core.CachedResource) []*HotPeerStat + func (w *HotCache) CollectMetrics() + func (w *HotCache) GetFilledPeriod(kind FlowKind) int + func (w *HotCache) IsResourceHot(res *core.CachedResource, hotDegree int) bool + func (w *HotCache) RandHotResourceFromContainer(containerID uint64, kind FlowKind, hotDegree int) *HotPeerStat + func (w *HotCache) ResetMetrics() + func (w *HotCache) ResourceStats(kind FlowKind) map[uint64][]*HotPeerStat + func (w *HotCache) Update(item *HotPeerStat) + type HotPeerStat struct + AntiCount int + ByteRate float64 + ContainerID uint64 + HotDegree int + KeyRate float64 + Kind FlowKind + LastUpdateTime time.Time + ResourceID uint64 + func (stat *HotPeerStat) Clone() *HotPeerStat + func (stat *HotPeerStat) GetByteRate() float64 + func (stat *HotPeerStat) GetKeyRate() float64 + func (stat *HotPeerStat) ID() uint64 + func (stat *HotPeerStat) IsLeader() bool + func (stat *HotPeerStat) IsNeedDelete() bool + func (stat *HotPeerStat) IsNew() bool + func (stat *HotPeerStat) Less(k int, than TopNItem) bool + type HotPeersStat struct + Count int + Stats []HotPeerStat + TotalBytesRate float64 + TotalKeysRate float64 + type HotStat struct + func NewHotStat() *HotStat + type LabelStatistics struct + func NewLabelStatistics() *LabelStatistics + func (l *LabelStatistics) ClearDefunctResource(resID uint64, labels []string) + func (l *LabelStatistics) Collect() + func (l *LabelStatistics) Observe(res *core.CachedResource, containers []*core.CachedContainer, labels []string) + func (l *LabelStatistics) Reset() + type ResourceStatInformer interface + IsResourceHot func(res *core.CachedResource) bool + RandHotResourceFromContainer func(container uint64, kind FlowKind) *core.CachedResource + ResourceReadStats func() map[uint64][]*HotPeerStat + ResourceWriteStats func() map[uint64][]*HotPeerStat + type ResourceStatisticType uint32 + const DownPeer + const EmptyResource + const ExtraPeer + const LearnerPeer + const MissPeer + const OfflinePeer + const PendingPeer + type ResourceStatistics struct + func NewResourceStatistics(opt *config.PersistOptions, ruleManager *placement.RuleManager) *ResourceStatistics + func (r *ResourceStatistics) ClearDefunctResource(resID uint64) + func (r *ResourceStatistics) Collect() + func (r *ResourceStatistics) GetResourceStatsByType(typ ResourceStatisticType) []*core.CachedResource + func (r *ResourceStatistics) Observe(res *core.CachedResource, containers []*core.CachedContainer) + func (r *ResourceStatistics) Reset() + type ResourceStats struct + ContainerLeaderCount map[uint64]int + ContainerLeaderKeys map[uint64]int64 + ContainerLeaderSize map[uint64]int64 + ContainerPeerCount map[uint64]int + ContainerPeerKeys map[uint64]int64 + ContainerPeerSize map[uint64]int64 + Count int + EmptyCount int + StorageKeys int64 + StorageSize int64 + func GetResourceStats(resources []*core.CachedResource) *ResourceStats + func (s *ResourceStats) Observe(r *core.CachedResource) + type RollingContainerStats struct + func (r *RollingContainerStats) GetBytesRate() (writeRate float64, readRate float64) + func (r *RollingContainerStats) GetBytesRateInstantaneous() (writeRate float64, readRate float64) + func (r *RollingContainerStats) GetBytesReadRate() float64 + func (r *RollingContainerStats) GetBytesWriteRate() float64 + func (r *RollingContainerStats) GetCPUUsage() float64 + func (r *RollingContainerStats) GetDiskReadRate() float64 + func (r *RollingContainerStats) GetDiskWriteRate() float64 + func (r *RollingContainerStats) GetKeysRate() (writeRate float64, readRate float64) + func (r *RollingContainerStats) GetKeysRateInstantaneous() (writeRate float64, readRate float64) + func (r *RollingContainerStats) GetKeysReadRate() float64 + func (r *RollingContainerStats) GetKeysWriteRate() float64 + func (r *RollingContainerStats) Observe(stats *rpcpb.ContainerStats) + func (r *RollingContainerStats) Set(stats *rpcpb.ContainerStats) + type TopN struct + func NewTopN(k, n int, ttl time.Duration) *TopN + func (tn *TopN) Get(id uint64) TopNItem + func (tn *TopN) GetAll() []TopNItem + func (tn *TopN) GetAllTopN(k int) []TopNItem + func (tn *TopN) GetTopNMin(k int) TopNItem + func (tn *TopN) Len() int + func (tn *TopN) Put(item TopNItem) (isUpdate bool) + func (tn *TopN) Remove(id uint64) (item TopNItem) + func (tn *TopN) RemoveExpired() + type TopNItem interface + ID func() uint64 + Less func(k int, than TopNItem) bool