Bug 1645424 - Improve differentiation of Firefox and Chrome raptor failures. r=perftest-reviewers,davehunt

This patch adds a class-variable to the RaptorLogger that will hold the application name being tested and it is only set when we test on Chrome. This will let us differentiate failure lines between Firefox and Chrome better, i.e. all failures without an app name in the line are Firefox failures, and otherwise they are Chrome failures.

Differential Revision: https://phabricator.services.mozilla.com/D79476
This commit is contained in:
Gregory Mierzwinski 2020-06-12 15:07:14 +00:00
parent 4863496e8f
commit a95569fe25
2 changed files with 14 additions and 3 deletions

View File

@ -10,10 +10,15 @@ from mozlog.proxy import ProxyLogger
class RaptorLogger():
app = ""
def __init__(self, component=None):
self.logger = ProxyLogger(component)
def set_app(self, app_name):
"""Sets the app name to prefix messages with."""
RaptorLogger.app = " [" + app_name + "]"
def exception(self, message, **kwargs):
self.critical(message, **kwargs)
@ -24,13 +29,13 @@ class RaptorLogger():
return self.logger.info("Info: {}".format(message), **kwargs)
def warning(self, message, **kwargs):
return self.logger.warning("Warning: {}".format(message), **kwargs)
return self.logger.warning("Warning:{} {}".format(RaptorLogger.app, message), **kwargs)
def error(self, message, **kwargs):
return self.logger.error("Error: {}".format(message), **kwargs)
return self.logger.error("Error:{} {}".format(RaptorLogger.app, message), **kwargs)
def critical(self, message, **kwargs):
return self.logger.critical("Critical: {}".format(message), **kwargs)
return self.logger.critical("Critical:{} {}".format(RaptorLogger.app, message), **kwargs)
def log_raw(self, message, **kwargs):
return self.logger.log_raw(message, **kwargs)

View File

@ -161,6 +161,12 @@ either Raptor or browsertime."""
if self.config["app"] == "fennec":
self.config["e10s"] = False
# To differentiate between chrome/firefox failures, we
# set an app variable in the logger which prefixes messages
# with the app name
if self.config["app"] in ("chrome", "chrome-m", "chromium"):
LOG.set_app(self.config["app"])
self.browser_name = None
self.browser_version = None