def test_slack(self, negative_slack_allowed_pct=15) -> ResultBundle: """ Assert that the RTApp workload was given enough performance :param negative_slack_allowed_pct: Allowed percentage of RT-app task activations with negative slack. :type negative_slack_allowed_pct: int Use :class:`lisa.analysis.rta.PerfAnalysis` to find instances where the RT-App workload wasn't able to complete its activations (i.e. its reported "slack" was negative). Assert that this happened less than ``negative_slack_allowed_pct`` percent of the time. """ analysis = PerfAnalysis.from_dir(self.res_dir) passed = True bad_activations = {} for task in analysis.tasks: slack = analysis.get_df(task)["Slack"] bad_activations_pct = len(slack[slack < 0]) * 100 / len(slack) if bad_activations_pct > negative_slack_allowed_pct: passed = False bad_activations[task] = bad_activations_pct res = ResultBundle.from_bool(passed) for task, bad_activations_pct in bad_activations.items(): res.add_metric("{} delayed activations".format(task), bad_activations_pct, '%') return res
def assert_can_read_logfile(self, exp_tasks): """Assert that the perf_analysis module understands the log output""" analysis = PerfAnalysis.from_dir(self.res_dir) exp_tasks = [re.sub(r'-[0-9]+', '', task) for task in exp_tasks] self.assertSetEqual(set(exp_tasks), set(analysis.tasks))
def assert_can_read_logfile(self, exp_tasks): """Assert that the perf_analysis module understands the log output""" analysis = PerfAnalysis.from_dir(self.res_dir) self.assertSetEqual(set(exp_tasks), set(analysis.tasks))
def assert_can_read_logfile(self, exp_tasks): """Assert that the perf_analysis module understands the log output""" with pytest.warns(DeprecationWarning): analysis = PerfAnalysis.from_dir(self.res_dir) exp_tasks = [re.sub(r'-[0-9]+', '', task) for task in exp_tasks] assert set(exp_tasks) == set(analysis.tasks)