Hello Yaniv Bronhaim, Antoni Segura Puimedon, Francesco Romani,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/30574

to review the following change.

Change subject: connectivity log: report if Engine has been seen recently
......................................................................

connectivity log: report if Engine has been seen recently

Vdsm monitors when it has been accessed by a client (most probably
Engine). If Vdsm finds out that it has not been accessed for the last 30
seconds (twice the Enginei's polling rate), "recent_client:False" is
logged to the connectivity.log. When polling is restored,
"recent_client:True" is reported.

Bug-Url: https://bugzilla.redhat.com/1122010
Change-Id: Ice088421d82f60e59ada6e743aeac2704c44cb7f
Signed-off-by: Dan Kenigsberg <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/30226
Reviewed-by: Antoni Segura Puimedon <[email protected]>
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/30523
Reviewed-by: Yaniv Bronhaim <[email protected]>
---
M vdsm/sampling.py
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/30574/1

diff --git a/vdsm/sampling.py b/vdsm/sampling.py
index dc3ebd3..1b7998b 100644
--- a/vdsm/sampling.py
+++ b/vdsm/sampling.py
@@ -36,7 +36,7 @@
 from vdsm import utils
 from vdsm import netinfo
 from vdsm.ipwrapper import getLinks
-from vdsm.constants import P_VDSM_RUN
+from vdsm.constants import P_VDSM_RUN, P_VDSM_CLIENT_LOG
 
 _THP_STATE_PATH = '/sys/kernel/mm/transparent_hugepage/enabled'
 if not os.path.exists(_THP_STATE_PATH):
@@ -204,10 +204,16 @@
         except:
             self.thpState = 'never'
 
+        ENGINE_DEFAULT_POLL_INTERVAL = 15
+        self.recentClient = (
+            self.timestamp - os.stat(P_VDSM_CLIENT_LOG).st_mtime <
+            2 * ENGINE_DEFAULT_POLL_INTERVAL)
+
     def to_connlog(self):
-        return ', '.join(
+        text = ', '.join(
             ('%s:(%s)' % (ifid, ifacesample.to_connlog()))
             for (ifid, ifacesample) in self.interfaces.iteritems())
+        return ('recent_client:%s, ' % self.recentClient) + text
 
     def connlog_diff(self, other):
         text = ''
@@ -218,6 +224,10 @@
                     text += '%s:(%s) ' % (ifid, diff)
             else:
                 text += 'new %s:(%s) ' % (ifid, sample.to_connlog())
+
+        if self.recentClient != other.recentClient:
+            text += 'recent_client:%s' % self.recentClient
+
         return text
 
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice088421d82f60e59ada6e743aeac2704c44cb7f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to