Storage: Query stats within a namespace (#97403)

This commit is contained in:
Ryan McKinley
2024-12-05 13:58:13 +03:00
committed by GitHub
parent 3724ffd858
commit 8165258a2d
12 changed files with 64 additions and 7 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ func (s *cdkBackend) getPath(key *ResourceKey, rv int64) string {
}
// GetResourceStats implements Backend.
func (s *cdkBackend) GetResourceStats(ctx context.Context, minCount int) ([]ResourceStats, error) {
func (s *cdkBackend) GetResourceStats(ctx context.Context, namespace string, minCount int) ([]ResourceStats, error) {
return nil, fmt.Errorf("not implemented")
}
+1 -1
View File
@@ -179,7 +179,7 @@ func (s *searchSupport) init(ctx context.Context) error {
group := errgroup.Group{}
group.SetLimit(s.initWorkers)
stats, err := s.storage.GetResourceStats(ctx, s.initMinSize)
stats, err := s.storage.GetResourceStats(ctx, "", s.initMinSize)
if err != nil {
return err
}
+2 -1
View File
@@ -95,7 +95,8 @@ type StorageBackend interface {
// For HA setups, this will be more events than the local WriteEvent above!
WatchWriteEvents(ctx context.Context) (<-chan *WrittenEvent, error)
GetResourceStats(ctx context.Context, minCount int) ([]ResourceStats, error)
// Get resource stats within the storage backend. When namespace is empty, it will apply to all
GetResourceStats(ctx context.Context, namespace string, minCount int) ([]ResourceStats, error)
}
type ResourceStats struct {