jenkins-bot has submitted this change and it was merged.
Change subject: Rename service monitor to web service monitor
......................................................................
Rename service monitor to web service monitor
It handles only web services!
Also rename and simplify the graphite metric names
Change-Id: Iee1a0f8e79fbc67b6bb7464fc24c76d2bc4f074f
---
R tools/manifest/webservicemonitor.py
1 file changed, 6 insertions(+), 9 deletions(-)
Approvals:
Yuvipanda: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tools/manifest/servicemonitor.py
b/tools/manifest/webservicemonitor.py
similarity index 80%
rename from tools/manifest/servicemonitor.py
rename to tools/manifest/webservicemonitor.py
index a3912fc..ad55556 100644
--- a/tools/manifest/servicemonitor.py
+++ b/tools/manifest/webservicemonitor.py
@@ -5,10 +5,7 @@
import xml.etree.ElementTree as ET
-class ServiceMonitor(ManifestCollector):
- def _webjob_name(self, manifest):
- return '%s-%s' % (manifest.webservice_server, manifest.tool.name)
-
+class WebServiceMonitor(ManifestCollector):
def _start_webservice(self, manifest):
self.log.info('Starting webservice for tool %s', manifest.tool.name)
try:
@@ -24,11 +21,11 @@
return True
except subprocess.CalledProcessError as e:
self.log.exception('Could not start webservice for tool %s',
manifest.tool.name)
- self.stats.incr('webservice_startfailed')
+ self.stats.incr('startfailed')
manifest.tool.log('Could not start webservice - webservice tool
exited with error code %s' % e.returncode)
except subprocess.TimeoutExpired:
self.log.exception('Timed out attempting to start webservice for
tool %s', manifest.tool.name)
- self.stats.incr('webservice_startfailed')
+ self.stats.incr('startfailed')
manifest.tool.log('Timed out attempting to start webservice (15s)')
def run(self):
@@ -37,16 +34,16 @@
for manifest in self.manifests:
if manifest.webservice_server is None:
continue
- job = qstat_xml.find('.//job_list[JB_name="%s"]' %
self._webjob_name(manifest))
+ job = qstat_xml.find('.//job_list[JB_name="%s-%s"]' %
(manifest.webservice_server, manifest.tool.name))
if job is None or 'r' not in job.findtext('.//state'):
manifest.tool.log('No running webservice job found, starting
it')
if self._start_webservice(manifest):
restarts_count += 1
self.log.info('Service monitor run completed, %s webservices
restarted', restarts_count)
- self.stats.incr('webservices_restarted', restarts_count)
+ self.stats.incr('startsuccess', restarts_count)
if __name__ == '__main__':
- sm = ServiceMonitor()
+ sm = WebServiceMonitor()
sm.collect()
sm.run()
--
To view, visit https://gerrit.wikimedia.org/r/202343
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iee1a0f8e79fbc67b6bb7464fc24c76d2bc4f074f
Gerrit-PatchSet: 3
Gerrit-Project: operations/software/tools-manifest
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits