This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
srs_andre gerrit-no-reply at lists.osmocom.orgsrs_andre has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18986 ) Change subject: {ms,enb}_srs: add method to read kpi from a test run ...................................................................... {ms,enb}_srs: add method to read kpi from a test run this method uses the kpi_analyzer module for analyzing stdout, CSV metrics and the logfile (if present). if the module can't be loaded, no KPI will be added. Change-Id: I28226a375f9ac4e08424c488062ae6a74a19af92 --- M src/osmo_gsm_tester/obj/enb_srs.py M src/osmo_gsm_tester/obj/ms_srs.py A src/osmo_gsm_tester/obj/srslte_common.py 3 files changed, 48 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/18986/1 diff --git a/src/osmo_gsm_tester/obj/enb_srs.py b/src/osmo_gsm_tester/obj/enb_srs.py index 0bf4f8b..fe1ea4e 100644 --- a/src/osmo_gsm_tester/obj/enb_srs.py +++ b/src/osmo_gsm_tester/obj/enb_srs.py @@ -23,6 +23,7 @@ from ..core import log, util, config, template, process, remote from . import enb from . import rfemu +from .srslte_common import srslte_common from ..core import schema @@ -36,7 +37,7 @@ def rf_type_valid(rf_type_str): return rf_type_str in ('zmq', 'uhd', 'soapy', 'bladerf') -class srsENB(enb.eNodeB): +class srsENB(enb.eNodeB, srslte_common): REMOTE_DIR = '/osmo-gsm-tester-srsenb' BINFILE = 'srsenb' @@ -68,6 +69,7 @@ self.remote_log_file = None self.remote_pcap_file = None self.enable_pcap = False + self.metrics_file = None self.testenv = testenv self._additional_args = [] if not rf_type_valid(conf.get('rf_dev_type', None)): @@ -89,6 +91,9 @@ except Exception as e: self.log(repr(e)) + # Collect KPIs for each TC + self.testenv.test().set_kpis(self.get_kpis()) + def start(self, epc): self.log('Starting srsENB') self._epc = epc diff --git a/src/osmo_gsm_tester/obj/ms_srs.py b/src/osmo_gsm_tester/obj/ms_srs.py index 04df1ba..e4177ba 100644 --- a/src/osmo_gsm_tester/obj/ms_srs.py +++ b/src/osmo_gsm_tester/obj/ms_srs.py @@ -26,6 +26,7 @@ from .run_node import RunNode from ..core.event_loop import MainLoop from .ms import MS +from .srslte_common import srslte_common def rf_type_valid(rf_type_str): return rf_type_str in ('zmq', 'uhd', 'soapy', 'bladerf') @@ -64,7 +65,7 @@ def num_prb2base_srate(num_prb): return num_prb2symbol_sz(num_prb) * 15 * 1000 -class srsUE(MS): +class srsUE(MS, srslte_common): REMOTE_DIR = '/osmo-gsm-tester-srsue' BINFILE = 'srsue' @@ -120,6 +121,9 @@ except Exception as e: self.log(repr(e)) + # Collect KPIs for each TC + self.testenv.test().set_kpis(self.get_kpis()) + def scp_back_metrics(self, raiseException=True): ''' Copy back metrics only if they have not been copied back yet ''' if not self.have_metrics_file: diff --git a/src/osmo_gsm_tester/obj/srslte_common.py b/src/osmo_gsm_tester/obj/srslte_common.py new file mode 100644 index 0000000..c4087ce --- /dev/null +++ b/src/osmo_gsm_tester/obj/srslte_common.py @@ -0,0 +1,37 @@ +# osmo_gsm_tester: common methods shared among srsLTE components +# +# Copyright (C) 2020 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol <pespin at sysmocom.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +class srslte_common(): + + def get_kpis(self): + ''' Use the srsLTE KPI analyzer module if available to collect UE KPIs ''' + kpis = {} + try: + from kpi_analyzer import kpi_analyzer + analyzer = kpi_analyzer(self.name()) + if self.log_file is not None: + kpis["log_" + self.name()] = analyzer.get_kpi_from_logfile(self.log_file) + if self.process.get_output_file('stdout') is not None: + kpis["stdout_" + self.name()] = analyzer.get_kpi_from_stdout(self.process.get_output_file('stdout')) + if self.metrics_file is not None: + kpis["csv_" + self.name()] = analyzer.get_kpi_from_csv(self.metrics_file) + except ImportError: + print("Can't load KPI analyzer module.") + + return kpis -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18986 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Change-Id: I28226a375f9ac4e08424c488062ae6a74a19af92 Gerrit-Change-Number: 18986 Gerrit-PatchSet: 1 Gerrit-Owner: srs_andre <andre at softwareradiosystems.com> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200623/1f5211e6/attachment.htm>