-
Notifications
You must be signed in to change notification settings - Fork 2
chore(core): add indexers for slowest client.List operations #1641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR adds a new indexer for VirtualMachine by IP and registers it in the global indexers list, refactors handler List calls to use MatchingFields for index-based queries to improve performance, and updates tests to use testutil.NewFakeClientWithObjects instead of manual fake client building. Sequence diagram for optimized List operation using indexerssequenceDiagram
participant Handler
participant Client
participant Indexer
participant VirtualMachineList
Handler->>Client: List(VirtualMachineList, MatchingFields{IndexFieldVMByVD: vd.Name})
Client->>Indexer: Use IndexFieldVMByVD to filter
Indexer-->>Client: Return filtered VirtualMachineList
Client-->>Handler: Return VirtualMachineList
Sequence diagram for List operation by IP using new indexersequenceDiagram
participant AttachedHandler
participant Client
participant Indexer
participant VirtualMachineList
AttachedHandler->>Client: List(VirtualMachineList, MatchingFields{IndexFieldVMByIP: vmip.Status.Address})
Client->>Indexer: Use IndexFieldVMByIP to filter
Indexer-->>Client: Return filtered VirtualMachineList
Client-->>AttachedHandler: Return VirtualMachineList
Class diagram for new and updated indexers in VirtualMachineclassDiagram
class VirtualMachine {
+status: Status
+spec: Spec
}
class Status {
+ipAddress: string
+node: string
}
class Spec {
+blockDeviceRefs: BlockDeviceRefs
}
class BlockDeviceRefs {
+VirtualDisk: string
+VirtualImage: string
+ClusterVirtualImage: string
}
class IndexGetters {
+IndexVMByVD()
+IndexVMByVI()
+IndexVMByCVI()
+IndexVMByIP() % newly added
+IndexVMByNode()
}
VirtualMachine --> Status
VirtualMachine --> Spec
Spec --> BlockDeviceRefs
IndexGetters --> VirtualMachine : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Workflow has started. The target step completed with status: failure. |
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
e42aea2 to
40cabe4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
|
Workflow has started. The target step completed with status: failure. |
|
Workflow has started. The target step completed with status: failure. |
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Description
Use indexers for better performance. List on large size of namespaces drastically increases cpu usage, using indexers divide it by 2.
Checklist
Changelog entries