Nir Soffer has uploaded a new change for review.

Change subject: image: Make progress report internal configurable
......................................................................

image: Make progress report internal configurable

Previously we logged a progress report every 60 seconds during qemu-img
operations. This seems too long, in particular when watching the logs
during testing. Decrease the interval to 30 seconds, and make it
configurable (irs:progress_interval).

Here is an example, using 10 seconds progress interval:

    2015-12-14 00:15:39,042 waiting for qemu-img operation to complete
    2015-12-14 00:15:49,045 qemu-img operation progress: 9.11%
    2015-12-14 00:15:59,041 qemu-img operation progress: 20.25%
    2015-12-14 00:16:09,042 qemu-img operation progress: 29.36%
    2015-12-14 00:16:19,043 qemu-img operation progress: 39.48%
    2015-12-14 00:16:29,043 qemu-img operation progress: 50.62%
    2015-12-14 00:16:39,039 qemu-img operation progress: 60.74%
    2015-12-14 00:16:49,038 qemu-img operation progress: 69.85%
    2015-12-14 00:16:59,042 qemu-img operation progress: 79.97%
    2015-12-14 00:17:09,044 qemu-img operation progress: 91.11%
    2015-12-14 00:17:17,828 qemu-img operation progress: 100.0%
    2015-12-14 00:17:17,829 qemu-img operation has completed

Change-Id: Ice27c49cc4902c24325e0d96eadec50532dfe40f
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/storage/image.py
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/50405/1

diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 73bcb2b..ce0ec47 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -346,6 +346,11 @@
         ('oop_impl', 'ioprocess',
             'Whether to use RFH or ioprocess implementation for oop.'
             'Values can be either ioprocess or rfh.'),
+
+        ('progress_interval', '30',
+            'Time to wait (in seconds) between consecutive progress reports '
+            'during long operations such as copying images (default 30)'),
+
     ]),
 
     # Section: [addresses]
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 6da4332..d9b8327 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -27,6 +27,7 @@
 import volume
 from vdsm import qemuimg
 from vdsm import virtsparsify
+from vdsm.config import config
 from sdc import sdCache
 import sd
 import misc
@@ -111,7 +112,6 @@
     """
     log = logging.getLogger('Storage.Image')
     _fakeTemplateLock = threading.Lock()
-    _QEMU_LOGGING_INTERVAL = 60.0
 
     @classmethod
     def createImageRollback(cls, taskObj, imageDir):
@@ -137,8 +137,9 @@
         self.log.debug('waiting for qemu-img operation to complete')
 
         with vars.task.abort_callback(operation.abort):
+            interval = config.getint("irs", "progress_interval")
             while not operation.finished:
-                operation.wait(self._QEMU_LOGGING_INTERVAL)
+                operation.wait(interval)
                 self.log.debug('qemu-img operation progress: %s%%',
                                operation.progress)
 


-- 
To view, visit https://gerrit.ovirt.org/50405
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice27c49cc4902c24325e0d96eadec50532dfe40f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to