ms_srs: add min_rolling_average calculation

useful metric to detect low/zero downlink throughput for longer
time periods

Change-Id: I77a82a68689bc6c21cb9227dc9e7616d03e2b547
This commit is contained in:
Andre Puschmann 2020-06-30 18:08:41 +02:00
parent ba40facbaf
commit f8c99a863d
1 changed files with 4 additions and 1 deletions

View File

@ -400,7 +400,7 @@ numpy = None
class srsUEMetrics(log.Origin):
VALID_OPERATIONS = ['avg', 'sum', 'max_rolling_avg']
VALID_OPERATIONS = ['avg', 'sum', 'max_rolling_avg', 'min_rolling_avg']
VALID_CRITERION = ['eq','gt','lt']
CRITERION_TO_SYM = { 'eq' : '==', 'gt' : '>', 'lt' : '<' }
CRYTERION_TO_SYM_OPPOSITE = { 'eq' : '!=', 'gt' : '<=', 'lt' : '>=' }
@ -458,6 +458,9 @@ class srsUEMetrics(log.Origin):
elif operation == 'max_rolling_avg':
# calculate rolling average over window and take maximum value
result = numpy.amax(numpy.convolve(sel_data, numpy.ones((window,))/window, mode='valid'))
elif operation == 'min_rolling_avg':
# calculate rolling average over window and take minimum value
result = numpy.amin(numpy.convolve(sel_data, numpy.ones((window,))/window, mode='valid'))
self.dbg(result=result, value=value)