Storage: Query stats within a namespace (#97403)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user