Skip to content
Open
4 changes: 4 additions & 0 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,10 @@ Let's walk briefly through the most important parts of its configuration:

Let's rerun our STREAM example using the new configuration:

.. note::

After Reframe 4.9 ReFrame will add entries in the perflogs for all tests, not only performance tests.

.. code-block:: bash
:caption: Run with the Docker compose setup.

Expand Down
16 changes: 14 additions & 2 deletions reframe/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,10 @@ def _update_check_extras(self):
'%FT%T%:z'
)

def log_performance(self, level, task, msg=None, multiline=False):
if self.check is None or not self.check.is_performance_check():
def log_result(
self, level, task, msg=None, multiline=False
):
if self.check is None:
return

_, part, env = task.testcase
Expand Down Expand Up @@ -960,6 +962,16 @@ def log_performance(self, level, task, msg=None, multiline=False):
self.extra['check_perf_unit'] = unit
self.extra['check_perf_result'] = result
self.log(level, msg)

if not self.check.perfvalues:
self.extra['check_perf_var'] = "$sanity_dummy"
self.extra['check_perf_value'] = None
self.extra['check_perf_ref'] = None
self.extra['check_perf_lower_thres'] = None
self.extra['check_perf_upper_thres'] = None
self.extra['check_perf_unit'] = None
self.extra['check_perf_result'] = None
self.log(level, msg)
Comment on lines +966 to +974
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to do it a bit more native if possible. This is like we are hacking the perfvalues to make it work for logging sanity-only tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is not needed at all. It's very easy to achieve what we want by simply removing the following check:

diff --git a/reframe/core/logging.py b/reframe/core/logging.py
index e166f857b..b44b1d8d8 100644
--- a/reframe/core/logging.py
+++ b/reframe/core/logging.py
@@ -931,7 +931,7 @@ class LoggerAdapter(logging.LoggerAdapter):
         )
 
     def log_performance(self, level, task, msg=None, multiline=False):
-        if self.check is None or not self.check.is_performance_check():
+        if self.check is None:
             return
 
         _, part, env = task.testcase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think the only changes needed are the following:

  1. Remove the check above
  2. Rename the log_performance() to log_result()

The only question remaining is whether we need a configuration option for this.

else:
self.log(level, msg)

Expand Down
8 changes: 4 additions & 4 deletions reframe/frontend/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ def finalize(self):
self._current_stage = 'finalize'
self._notify_listeners('on_task_success')
try:
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
self._perflogger.log_result(logging.INFO, self,
multiline=self._perflog_compat)
except LoggingError as e:
getlogger().warning(
f'could not log performance data for {self.testcase}: {e}'
Expand All @@ -550,8 +550,8 @@ def _wait_job(job):
self._exc_info = exc_info or sys.exc_info()
self._notify_listeners(callback)
try:
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
self._perflogger.log_result(logging.INFO, self,
multiline=self._perflog_compat)
except LoggingError as e:
getlogger().warning(
f'could not log performance data for {self.testcase}: {e}'
Expand Down
Loading