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/+/18473 ) Change subject: ms_srs: allow + operator when specifying CSV columns ...................................................................... ms_srs: allow + operator when specifying CSV columns this allows to sum dl_brate and ul_brate and perform the known operations, like max, average, etc. on both UL and DL bitrate combined Change-Id: I5c7c80bb107fa6b93b215176e6ebbb5dc8594860 --- M src/osmo_gsm_tester/obj/ms_srs.py 1 file changed, 16 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/73/18473/1 diff --git a/src/osmo_gsm_tester/obj/ms_srs.py b/src/osmo_gsm_tester/obj/ms_srs.py index 571a964..dfd03b4 100644 --- a/src/osmo_gsm_tester/obj/ms_srs.py +++ b/src/osmo_gsm_tester/obj/ms_srs.py @@ -373,17 +373,26 @@ self.err("Error parsing metrics CSV file %s" % self.metrics_file) raise error - def verify(self, value, operation='avg', metric='dl_brate', criterion='gt', window=1): + def verify(self, value, operation='avg', metric_str='dl_brate', criterion='gt', window=1): if operation not in self.VALID_OPERATIONS: raise log.Error('Unknown operation %s not in %r' % (operation, self.VALID_OPERATIONS)) if criterion not in self.VALID_CRITERION: raise log.Error('Unknown operation %s not in %r' % (operation, self.VALID_CRITERION)) # check if given metric exists in data - try: - sel_data = self.raw_data[metric] - except ValueError as err: - print('metric %s not available' % metric) - raise err + sel_data = numpy.array([]) + metrics_list = metric_str.split('+') # allow addition operator for columns + for metric in metrics_list: + try: + vec = numpy.array(self.raw_data[metric]) + except ValueError as err: + print('metric %s not available' % metric) + raise err + if sel_data.size == 0: + # Initialize with dimension of first metric vector + sel_data = vec + else: + # Sum them up assuming same array dimension + sel_data += vec if operation == 'avg': result = numpy.average(sel_data) @@ -402,7 +411,7 @@ success = True # Convert bitrate in Mbit/s: - if metric.find('brate') > 0: + if metric_str.find('brate') > 0: result /= 1e6 value /= 1e6 mbit_str = ' Mbit/s' -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18473 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: I5c7c80bb107fa6b93b215176e6ebbb5dc8594860 Gerrit-Change-Number: 18473 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/20200525/ae7aa25e/attachment.htm>