Commit 6b1151f7 authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_base: Improve KPI calculation error handling

parent 71d02c8d
...@@ -7,13 +7,18 @@ def load_measurements(alogm): ...@@ -7,13 +7,18 @@ def load_measurements(alogm):
try: try:
measurement = alogm.read() measurement = alogm.read()
while measurement is not None: while measurement is not None:
try:
mlog.append(measurement) mlog.append(measurement)
except AssertionError:
# Invalid measurement: simply skip it
pass
measurement = alogm.read() measurement = alogm.read()
finally: finally:
alogm.close() alogm.close()
return mlog return mlog
def calc_periods(mlog, tperiod): def calc_periods(mlog, tperiod):
try:
t = mlog.data()[0]['X.Tstart'] t = mlog.data()[0]['X.Tstart']
for measurement in mlog.data()[1:]: for measurement in mlog.data()[1:]:
t_ = measurement['X.Tstart'] t_ = measurement['X.Tstart']
...@@ -21,6 +26,9 @@ def calc_periods(mlog, tperiod): ...@@ -21,6 +26,9 @@ def calc_periods(mlog, tperiod):
calc = kpi.Calc(mlog, t, t + tperiod) calc = kpi.Calc(mlog, t, t + tperiod)
t = calc.tau_hi t = calc.tau_hi
yield calc yield calc
except IndexError:
# No data to read: exit
return
def getOrsKpiValues(data): def getOrsKpiValues(data):
fxlog = io.StringIO(data) fxlog = io.StringIO(data)
......
...@@ -37,12 +37,7 @@ for array in out_array: ...@@ -37,12 +37,7 @@ for array in out_array:
if array['variation'] == 'e_utran': if array['variation'] == 'e_utran':
e_utran_data_array = array['Data Array'] e_utran_data_array = array['Data Array']
try: vt, v_initial_epsb_estab_sr, v_added_epsb_estab_sr, evt, v_ip_throughput_qci = context.Base_getOrsKpiValues(log_data)
vt, v_initial_epsb_estab_sr, v_added_epsb_estab_sr, evt, v_ip_throughput_qci = context.Base_getOrsKpiValues(log_data)
except AssertionError:
# If some data is invalid: ignore data chunk and move on rather than crashing
progress_indicator.setIntOffsetIndex(end)
return
e_rab_dtype = np.dtype([ e_rab_dtype = np.dtype([
('vt', 'float'), ('vt', 'float'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment