Commit 1ad709c4 authored by Paul Graydon's avatar Paul Graydon

ors_wendelin: Clean up

parent ce96be72
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>view_e-rab_accessibility_kpi</string> </value> <value> <string>view_e_rab_accessibility_kpi</string> </value>
</item> </item>
<item> <item>
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DataAcquisitionUnit_viewE-RABAccessibilityKPI</string> </value> <value> <string>string:${object_url}/DataAcquisitionUnit_viewERabAccessibilityKpi</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>view_e-utran-ip-throughput_kpi</string> </value> <value> <string>view_e_utran_ip_throughput_kpi</string> </value>
</item> </item>
<item> <item>
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DataAcquisitionUnit_viewE-UTRANIPThroughputKPI</string> </value> <value> <string>string:${object_url}/DataAcquisitionUnit_viewEUtranIpThroughputKpi</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
from xlte.amari import kpi as amari_kpi
from xlte import kpi
import io
def load_measurements(alogm):
mlog = kpi.MeasurementLog()
try:
measurement = alogm.read()
while measurement is not None:
mlog.append(measurement)
measurement = alogm.read()
finally:
alogm.close()
return mlog
def calc_periods(mlog, tperiod):
t = mlog.data()[0]['X.Tstart']
for measurement in mlog.data()[1:]:
t_ = measurement['X.Tstart']
if (t_ - t) >= tperiod:
calc = kpi.Calc(mlog, t, t + tperiod)
t = calc.tau_hi
yield calc
def getOrsKpiValues(data):
fxlog = io.StringIO(data)
alogm = amari_kpi.LogMeasure(fxlog, open('/dev/null', 'r'))
mlog = load_measurements(alogm)
vt = []
v_initial_epsb_estab_sr = []
v_added_epsb_estab_sr = []
tperiod = 60 # seconds
for calc in calc_periods(mlog, tperiod):
vt.append(calc.tau_lo)
erab_accessibility = calc.erab_accessibility()
v_initial_epsb_estab_sr.append((erab_accessibility[0]['lo'], erab_accessibility[0]['hi']))
v_added_epsb_estab_sr.append((erab_accessibility[1]['lo'], erab_accessibility[1]['hi']))
evt = []
v_ip_throughput_qci = []
tperiod = 3 # seconds
for calc in calc_periods(mlog, tperiod):
evt.append(calc.tau_lo)
eutran_ip_throughput = calc.eutran_ip_throughput()
period_qci_data = []
for qci, qci_measurement in enumerate(eutran_ip_throughput):
period_qci_data.append((qci, qci_measurement['dl']['lo'], qci_measurement['dl']['hi'], qci_measurement['ul']['lo'], qci_measurement['ul']['hi']))
v_ip_throughput_qci.append(period_qci_data)
return vt, v_initial_epsb_estab_sr, v_added_epsb_estab_sr, evt, v_ip_throughput_qci
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>XlteUtils</string> </value> <value> <string>OrsKpiUtils</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>extension.erp5.XlteUtils</string> </value> <value> <string>extension.erp5.OrsKpiUtils</string> </value>
</item> </item>
<item> <item>
<key> <string>sid</string> </key> <key> <string>sid</string> </key>
......
from xlte.amari import kpi as akpi
from xlte import kpi
import io
#import numpy as np
def load_measurements(alogm):
mlog = kpi.MeasurementLog()
try:
while 1:
m = alogm.read()
if m is None:
break
mlog.append(m)
finally:
alogm.close()
return mlog
def calc_each_period(mlog, tperiod):
t = mlog.data()[0]['X.Tstart']
for m in mlog.data()[1:]:
t_ = m['X.Tstart']
if (t_ - t) >= tperiod:
calc = kpi.Calc(mlog, t, t + tperiod)
t = calc.tau_hi
yield calc
def getORSKPIValue(data):
fxlog = io.StringIO(data)
alogm = akpi.LogMeasure(fxlog, open('/dev/null', 'r'))
mlog = load_measurements(alogm)
vt = []
vInititialEPSBEstabSR = []
vAddedEPSBEstabSR = []
for calc in calc_each_period(mlog, 60): # 60 seconds
vt.append(calc.tau_lo)
x = calc.erab_accessibility() # E-RAB Accessibility
vInititialEPSBEstabSR.append((x[0]['lo'], x[0]['hi']))
vAddedEPSBEstabSR.append((x[1]['lo'], x[1]['hi']))
#vt = np.asarray([x for x in vt])
#vInititialEPSBEstabSR = np.asarray(vInititialEPSBEstabSR)
#vAddedEPSBEstabSR = np.asarray(vAddedEPSBEstabSR)
# E-UTRAN IP Throughput KPI.
evt = []
vIPThp_qci = []
for calc in calc_each_period(mlog, 3): # 3 seconds
evt.append(calc.tau_lo)
x = calc.eutran_ip_throughput() # E-UTRAN IP Throughput
tmp = []
for qci, qci_data in enumerate(x):
tmp.append((qci, qci_data['dl']['lo'], qci_data['dl']['hi'], qci_data['ul']['lo'], qci_data['ul']['hi']))
vIPThp_qci.append(tmp)
# evt = np.asarray([x for x in evt])
# vIPThp_qci = vIPThp_qci
return vt, vInititialEPSBEstabSR, vAddedEPSBEstabSR, evt, vIPThp_qci
...@@ -60,6 +60,10 @@ ...@@ -60,6 +60,10 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>calculate_ors_kpi</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -68,7 +72,13 @@ ...@@ -68,7 +72,13 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ors_kpi</string> </value> <value> <string>calculate_ors_kpi</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>script_id</string> </key> <key> <string>script_id</string> </key>
...@@ -76,13 +86,11 @@ ...@@ -76,13 +86,11 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>ORS Calculate KPI</string> </value> <value> <string>Calculate ORS KPI</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
<value> <value> <string>001</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
...@@ -152,7 +160,7 @@ ...@@ -152,7 +160,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.25284.41439.37888</string> </value> <value> <string>1018.50460.57093.18414</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -172,7 +180,7 @@ ...@@ -172,7 +180,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718889733.66</float> <float>1724228941.27</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -165,16 +165,16 @@ ...@@ -165,16 +165,16 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>ors_ingest_log_data</string> </value> <value> <string>ingest_ors_enb_log_data</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>This data operation can be used to ingest ORS log data with fluentd.\n <value> <string>This data operation can be used to ingest ORS eNB log data with fluentd.\n
It assumes the data comes in MsgPack format, and extracts the log contents into a string stored in the Data Stream.</string> </value> It assumes the data comes in MsgPack format, and extracts the log contents into a string appended to the corresponding Data Stream.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ors_wendelin_ingest_log_data</string> </value> <value> <string>ingest_ors_enb_log_data</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -200,11 +200,11 @@ It assumes the data comes in MsgPack format, and extracts the log contents into ...@@ -200,11 +200,11 @@ It assumes the data comes in MsgPack format, and extracts the log contents into
</item> </item>
<item> <item>
<key> <string>script_id</string> </key> <key> <string>script_id</string> </key>
<value> <string>DataIngestionLine_writeOrsLogFluentdIngestionToDataStream</string> </value> <value> <string>DataIngestionLine_writeOrsFluentdIngestionToDataStream</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>ORS Ingest Log Data</string> </value> <value> <string>Ingest ORS eNB Log Data</string> </value>
</item> </item>
<item> <item>
<key> <string>use_list</string> </key> <key> <string>use_list</string> </key>
...@@ -286,7 +286,7 @@ It assumes the data comes in MsgPack format, and extracts the log contents into ...@@ -286,7 +286,7 @@ It assumes the data comes in MsgPack format, and extracts the log contents into
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.25596.32627.4386</string> </value> <value> <string>1018.50502.13845.29269</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -306,7 +306,7 @@ It assumes the data comes in MsgPack format, and extracts the log contents into ...@@ -306,7 +306,7 @@ It assumes the data comes in MsgPack format, and extracts the log contents into
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718891315.33</float> <float>1724234865.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Data Operation" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>quantity_unit/unit/piece</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>ors_resample_kpi</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ors_resample_kpi</string> </value>
</item>
<item>
<key> <string>script_id</string> </key>
<value> <string>DataAnalysisLine_resampleKPI</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>ORS Resample KPI</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1007.25754.27168.41318</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1680183995.23</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1680184003.01</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>ors_end_device</string> </value> <value> <string>ors_enb_log_data</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -81,11 +81,17 @@ ...@@ -81,11 +81,17 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ors_end_device</string> </value> <value> <string>ors_enb_log_data</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>ORS End Device</string> </value> <value> <string>ORS eNB Log Data</string> </value>
</item> </item>
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
...@@ -155,7 +161,7 @@ ...@@ -155,7 +161,7 @@