Sandro Bonazzola has uploaded a new change for review.

Change subject: Avoid hitting performance issues with api listing
......................................................................

Avoid hitting performance issues with api listing

After BZ1025320 default is provide all results
this limits results on each iteration to page_size

Related-To: http://bugzilla.redhat.com/1025320

Change-Id: I2c3cf488df334b5dcf43904a4c67f9abcbe38f87
Signed-off-by: Pablo <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1101421
(cherry picked from commit 8c2d3904eef9194d40c2247bd65ce9eee7c26c71)
---
M src/helper/hypervisors.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-log-collector 
refs/changes/31/28931/1

diff --git a/src/helper/hypervisors.py b/src/helper/hypervisors.py
index d691c97..5e546d9 100644
--- a/src/helper/hypervisors.py
+++ b/src/helper/hypervisors.py
@@ -153,11 +153,14 @@
     @param oquery: optional query to limit results
     """
     page = 0
-    length = 100
+    page_size = 100
+    length = page_size
     while length > 0:
         page += 1
         query = "%s page %s" % (oquery, page)
-        tanda = entity.list(query=query)
+        # after BZ1025320 default is provide all results
+        # this limits results on each iteration to page_size
+        tanda = entity.list(query=query, max=page_size)
         length = len(tanda)
         for elem in tanda:
             yield elem


-- 
To view, visit http://gerrit.ovirt.org/28931
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c3cf488df334b5dcf43904a4c67f9abcbe38f87
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-log-collector
Gerrit-Branch: ovirt-log-collector-3.4
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Pablo Iranzo Gómez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to