def parse_qmdl(plainTextFile): # Initialize an OfflineReplayer as monitor src = OfflineReplayer() m = MobilityMisconfigAnalyzer() for f in get_sorted_logs(plainTextFile): print '=========' + f + '========' m.reset() m.set_source(src) src.set_input_path(f) # Start the monitoring src.run() lte_mobility_misconfig_serving_cell_dict = m.get_lte_mobility_misconfig_serving_cell_dict( ) utra_mobility_misconfig_serving_cell_dict = m.get_3g_mobility_misconfig_serving_cell_dict( ) for CellIdentityCombine, CellInfo in lte_mobility_misconfig_serving_cell_dict.iteritems( ): print CellIdentityCombine jsonValue = json.dumps(CellInfo, indent=4, sort_keys=True) print jsonValue print "-----------------------------------------------------------" for CellIdentityCombine, CellInfo in utra_mobility_misconfig_serving_cell_dict.iteritems( ): print CellIdentityCombine jsonValue = json.dumps(CellInfo, indent=4, sort_keys=True) print jsonValue print "-----------------------------------------------------------"
def kpi_analysis(filename): # Get analyzer and log dir from the user src = OfflineReplayer() # src.set_input_path('../../../logs/0.qmdl') # src.set_input_path('../../../logs/exp30_HFDV_byYJ/example.qmdl') src.set_input_path(filename) # analyzer = LteCntAnalyzer() # analyzer = DlLatBdAnalyzer() analyzer = UlSampleAnalyzer() # analyzer = UlLatBreakdownAnalyzer() analyzer.set_source(src) # analyzer = LtePdcpGapAnalyzer() # analyzer.set_source(src) # analyzer1 = PktLossAnalyzer() # analyzer1.set_source(src) # analyzer2 = RlcUlRetxAnalyzer() # analyzer2.set_source(src) # analyzer.set_operator("hello") # analyzer.set_phone_model("hi") # Start the monitoring src.run()
class LogAnalyzer(Analyzer): """ A simple analyzer of log events """ def __init__(self, listener_callback): Analyzer.__init__(self) # a message dump has no analyzer in from/to_list # it only has a single callback for the source self.msg_logs = [] # in-memory message log self.src = OfflineReplayer() self.set_source(self.src) self.add_source_callback(self.__dump_message) self.listener_callback = listener_callback self.supported_types = set(dm_collector_c.log_packet_types) for st in self.supported_types: self.src.enable_log(st) # def AnalyzeFile(self, fileName,selectedTypes): # self.selectedTypes = selectedTypes # self.msg_logs = [] # self.src.set_input_path(fileName) # self.src.run() # if self.listener_callback: # self.listener_callback() def AnalyzeFile(self, Paths, selectedTypes): if Paths.__class__.__name__ != 'list': Paths = [Paths] self.selectedTypes = selectedTypes self.msg_logs = [] for fileName in Paths: self.src.set_input_path(fileName) self.src.run() if self.listener_callback: self.listener_callback() else: self.log_warning("no listener_callback ...") def __dump_message(self, msg): """ Print the received message :param msg: the received message """ if self.selectedTypes \ and msg.type_id not in self.selectedTypes: return payload = msg.data.decode_xml() timestamp_beg = payload.find("timestamp\">") + 11 timestamp_end = payload.find("</", timestamp_beg) msg_timestamp = payload[timestamp_beg:timestamp_end] self.msg_logs.append({ 'Timestamp': msg_timestamp, 'TypeID': msg.type_id, 'Payload': payload })
def ReadRawFile(filename): # Initialize a 3G/4G monitor src = OfflineReplayer() #src.set_input_path("./diag_log_20190701_032740_93cda9833356d6bc90e05d0f85b3efee_Google-PixelXL_311480.mi2log") src.set_input_path("./" + filename + ".mi2log") logger = MsgLogger() logger.set_decode_format(MsgLogger.XML) logger.set_dump_type(MsgLogger.FILE_ONLY) #logger.save_decoded_msg_as("./test.txt") logger.save_decoded_msg_as("./" + filename + ".txt") logger.set_source(src) # Analyzers lte_pdcp_analyzer = LtePdcpAnalyzer() lte_pdcp_analyzer.set_source(src) lte_rrc_analyzer = LteRrcAnalyzer() lte_rrc_analyzer.set_source(src) # bind with the monitor wcdma_rrc_analyzer = WcdmaRrcAnalyzer() wcdma_rrc_analyzer.set_source(src) # bind with the monitor lte_nas_analyzer = LteNasAnalyzer() lte_nas_analyzer.set_source(src) umts_nas_analyzer = UmtsNasAnalyzer() umts_nas_analyzer.set_source(src) lte_phy_analyzer = LtePhyAnalyzer() lte_phy_analyzer.set_source(src) lte_mac_analyzer = LteMacAnalyzer() lte_mac_analyzer.set_source(src) mm_analyzer = MmAnalyzer() mm_analyzer.set_source(src) lte_measurement_analyzer = LteMeasurementAnalyzer() lte_measurement_analyzer.set_source(src) lte_rlc_analyzer = LteRlcAnalyzer() lte_rlc_analyzer.set_source(src) #modem_Debug_Analyzer = ModemDebugAnalyzer() #modem_Debug_Analyzer.set_source(src) mobility_mngt = MobilityMngt() mobility_mngt.set_source(src) rrc_analyzer = RrcAnalyzer() rrc_analyzer.set_source(src) # Start the monitoring src.run()
def uplink_latency_analysis(): src = OfflineReplayer() # src.set_input_path("./logs/latency_sample.mi2log") src.set_input_path(sys.argv[1]) # print (sys.argv[1]) analyzer = UplinkLatencyAnalyzer() analyzer.set_source(src) src.run() return analyzer
def kpi_analysis(): src = OfflineReplayer() src.set_input_path(sys.argv[1]) analyzer = DLMacLatencyAnalyzer() analyzer.set_source(src) src.run() analyzer.log_info('Total packets: ' + str(analyzer.num)) analyzer.log_info('Number of TX delay: ' + str(analyzer.tx_delay_num)) analyzer.log_info('Number of blocked packets: ' + str(analyzer.block_delay_num))
def test(self): #Single analyzer test only Analyzer.reset() src = OfflineReplayer() src.set_input_path(log_path) #Indirectly call analyzer via include_analyzer test_analyzer = Analyzer() test_analyzer.include_analyzer(analyzer_name, []) test_analyzer.set_source(src) # Disable all MobileInsight logs logging.getLogger('mobileinsight_logger').setLevel(logging.CRITICAL) src.run()
def kpi_manager_example(path): src = OfflineReplayer() src.set_input_path(path) kpi_manager = KPIManager() # print "All supported KPIs:", str(kpi_manager.list_kpis()) # kpi_manager.enable_kpi("KPI.Accessibility.DEDICATED_BEARER_SR_QCI1_REQ", periodicity='10m') # kpi_manager.enable_kpi("KPI.Accessibility.DEDICATED_BEARER_SR_QCI1_SR", periodicity='2h') kpi_manager.enable_kpi("KPI.Accessibility.RRC_SUC") kpi_manager.enable_kpi("KPI.Accessibility.RRC_REQ") kpi_manager.enable_kpi("KPI.Accessibility.RRC_SR") kpi_manager.enable_kpi("KPI.Accessibility.RRC_LATENCY") kpi_manager.enable_kpi("KPI.Accessibility.SR_SUC") kpi_manager.enable_kpi("KPI.Accessibility.SR_REQ") kpi_manager.enable_kpi("KPI.Accessibility.SR_SR") kpi_manager.enable_kpi("KPI.Accessibility.SR_LATENCY") # kpi_manager.enable_kpi("KPI.Accessibility.ATTACH_SUC") # kpi_manager.enable_kpi("KPI.Accessibility.ATTACH_SR") # Test Mobility KPIs kpi_manager.enable_kpi("KPI.Mobility.HO_TOTAL") kpi_manager.enable_kpi("KPI.Mobility.HO_FAILURE") kpi_manager.enable_kpi("KPI.Mobility.HO_FAILURE_LATENCY") kpi_manager.enable_kpi("KPI.Mobility.HO_SR") kpi_manager.enable_kpi( "KPI.Mobility.HANDOVER_LATENCY") # test log: data_sample kpi_manager.enable_kpi("KPI.Accessibility.HO_LATENCY") kpi_manager.enable_kpi("KPI.Mobility.TAU_SUC") kpi_manager.enable_kpi("KPI.Mobility.TAU_REQ") kpi_manager.enable_kpi("KPI.Mobility.TAU_SR") kpi_manager.enable_kpi("KPI.Mobility.TAU_LATENCY") # kpi_manager.enable_kpi("KPI.Mobility.TAU_REQ", periodicity='1h') # Test Retainability KPIs # kpi_manager.enable_kpi("KPI.Retainability.RRC_AB_REL") # Test Integrity KPIs # kpi_manager.enable_kpi("KPI.Integrity.DL_TPUT") kpi_manager.set_source(src) src.run()
def parse_qmdl(path_input): # directory = "/home/moonsky219/ownCloud/mssn/misconfig_exp/data/Verizon/L714/" directory = path_input logs = get_sorted_logs(directory) # Initialize a 3G/4G monitor src = OfflineReplayer() m = IdleHandoffAnalyzer() for f in logs: # print "=== %s ===" % f m.reset() m.set_source(src) src.set_input_path(f) # Start the monitoring src.run()
def kpi_manager_example(path): src = OfflineReplayer() src.set_input_path(path) kpi_manager = KPIManager() # print "All supported KPIs:", str(kpi_manager.list_kpis()) # Test experimental KPIs - data plane kpi_manager.enable_kpi("KPI.Wireless.BLER") # test log: bler_sample kpi_manager.enable_kpi("KPI.Wireless.DL_PDCP_LOSS") # test log: data_sample kpi_manager.enable_kpi("KPI.Wireless.UL_PDCP_LOSS") # Test experimental KPIs - handover kpi_manager.enable_kpi("KPI.Mobility.HANDOVER_PREDICTION") # test log: data_sample kpi_manager.enable_kpi("KPI.Mobility.HANDOVER_LATENCY") # test log: data_sample kpi_manager.enable_kpi("KPI.Mobility.HANDOVER_HOL") # test log: data_sample kpi_manager.set_source(src) src.run()
def lte_phy_analysis(): src = OfflineReplayer() #src.set_input_path("./logs/latency_sample.mi2log") src.set_input_path(sys.argv[1]) # print (sys.argv[1]) phy_analyzer = goodsol_analyzer.MyAnalyzer() #phy_analyzer.set_source(src) meas_analyzer = lte_measurement_analyzer.LteMeasurementAnalyzer() meas_analyzer.set_source(src) uplink_analyzer = uplink_latency_analyzer.UplinkLatencyAnalyzer() #uplink_analyzer.set_source(src) mac_analyzer = lte_mac_analyzer.LteMacAnalyzer() #mac_analyzer.set_source(src) rlc_analyzer = lte_rlc_analyzer.LteRlcAnalyzer() rlc_analyzer.set_source(src) error_analyzer = lte_wireless_error_analyzer.LteWirelessErrorAnalyzer() #error_analyzer.set_source(src) fb_analyzer = object_latency_analyzer.ObjectLatencyAnalyzer() fb_analyzer.set_source(src) pdcp_analyer = lte_pdcp_ulgap_analyzer.LtePdcpUlGapAnalyzer() #pdcp_analyer.set_source(src) #mac_analyzer = lte_mac_analyzer.LteMacAnalyzer() #mac_analyzer.set_source(src) rrc_analyzer = lte_rrc_analyzer.LteRrcAnalyzer() #rrc_analyzer.set_source(src) src.run() return phy_analyzer, meas_analyzer, mac_analyzer, rlc_analyzer, fb_analyzer, pdcp_analyer
def generate_from_mi2log(filepath, output_filepath=None): src = OfflineReplayer() src.set_input_path(filepath) filename = get_filename_from_path(filepath) logger = MsgLogger() logger.set_decode_format(MsgLogger.XML) logger.set_dump_type(MsgLogger.FILE_ONLY) if (output_filepath is not None): op_fp = output_filepath else: op_fp = "./mi2log_xml/" + filename + "_" + datetime.now().strftime( "%H_%M_%S") + '.xml' logger.save_decoded_msg_as(op_fp) logger.set_source(src) # Analyzers lte_rrc_analyzer = LteRrcAnalyzer() lte_rrc_analyzer.set_source(src) # bind with the monitor # wcdma_rrc_analyzer = WcdmaRrcAnalyzer() # wcdma_rrc_analyzer.set_source(src) # bind with the monitor lte_nas_analyzer = LteNasAnalyzer() lte_nas_analyzer.set_source(src) # umts_nas_analyzer = UmtsNasAnalyzer() # umts_nas_analyzer.set_source(src) # lte_phy_analyzer = LtePhyAnalyzer() # lte_phy_analyzer.set_source(src) # lte_mac_analyzer = LteMacAnalyzer() # lte_mac_analyzer.set_source(src) # Start the monitoring src.run() clean_mi2log_xml(op_fp)
import os import sys """ Offline analysis by replaying logs """ # Import MobileInsight modules from mobile_insight.monitor import OfflineReplayer from mobile_insight.analyzer import MsgLogger, LteRrcAnalyzer, WcdmaRrcAnalyzer, LteNasAnalyzer, UmtsNasAnalyzer, LtePhyAnalyzer, LteMacAnalyzer if __name__ == "__main__": # Initialize a 3G/4G monitor src = OfflineReplayer() src.set_input_path("./offline_log_example.mi2log") logger = MsgLogger() logger.set_decode_format(MsgLogger.XML) logger.set_dump_type(MsgLogger.FILE_ONLY) logger.save_decoded_msg_as("./test.txt") logger.set_source(src) # Analyzers lte_rrc_analyzer = LteRrcAnalyzer() lte_rrc_analyzer.set_source(src) # bind with the monitor wcdma_rrc_analyzer = WcdmaRrcAnalyzer() wcdma_rrc_analyzer.set_source(src) # bind with the monitor lte_nas_analyzer = LteNasAnalyzer()
def parse_qmdl(path_input): # directory = "/home/moonsky219/ownCloud/mssn/misconfig_exp/data/Verizon/L714/" directory = path_input logs = get_sorted_logs(directory) # Initialize a 3G/4G monitor src = OfflineReplayer() m = MobilityMisconfigAnalyzer() for f in logs: # print "=== %s ===" % f m.reset() m.set_source(src) src.set_input_path(f) # Start the monitoring src.run() umts_normal_service_log = m.get_umts_normal_service_log() umts_plmn_search_log = m.get_umts_plmn_search_log() umts_attach_log = m.get_umts_attach_log() umts_lu_log = m.get_umts_lu_log() umts_rau_log = m.get_umts_rau_log() lte_normal_service_log = m.get_lte_normal_service_log() lte_plmn_search_log = m.get_lte_plmn_search_log() lte_attach_log = m.get_lte_attach_log() lte_tau_log = m.get_lte_tau_log() lte_tau_qos_info = m.get_lte_tau_qos_info() lte_cell_resel_to_umts_config = m.get_lte_cell_resel_to_umts_config() lte_drx_config = m.get_lte_drx_config() lte_tdd_config = m.get_lte_tdd_config() n_lte_rrc_reconfig = m.get_n_lte_rrc_reconfig() lte_mobility_misconfig_serving_cell_dict = m.get_lte_mobility_misconfig_serving_cell_dict( ) utra_mobility_misconfig_serving_cell_dict = m.get_3g_mobility_misconfig_serving_cell_dict( ) for CellIdentityCombine, CellInfo in lte_mobility_misconfig_serving_cell_dict.iteritems( ): print CellIdentityCombine InfoKey = "lte_rrc_cerv_cell_info" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib1]" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib3]cellReselectionInfoCommon_element" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib3]cellReselectionServingFreqInfo_element" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib3]intraFreqCellReselectionInfo_element" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib4]intraFreqBlackCellList" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib4]intraFreqNeighCellList" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib5]InterFreqCarrierFreqInfo_element" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib5]interFreqBlackCellList" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib5]interFreqNeighCellList" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib6]CarrierFreqUTRA_FDD_element" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib7]" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "[sib8]" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "lte_rrc_measurement_report" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "lte_measurement_report_config" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "lte_measurement_object" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "utra_3g_measurement_object" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "lte_report_configuration" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "2g3g_report_reconfiguration" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem print "-----------------------------------------------------------" for CellIdentityCombine, CellInfo in utra_mobility_misconfig_serving_cell_dict.iteritems( ): print CellIdentityCombine for InfoKey, InfoValue in CellInfo.iteritems(): if InfoKey == "umts_geolocation": continue print InfoKey if isinstance(InfoValue, list): for InfoValueItem in InfoValue: print InfoValueItem elif isinstance(InfoValue, dict): for InfoValueKey, InfoValueItem in InfoValue: print InfoValueKey print InfoValueItem print "-----------------------------------------------------------"
def kpi_analysis(): # src = OfflineReplayer() # src.set_input_path('/sdcard/mobileinsight/plugins/test_analyzer/vr_log.mi2log') # cache_directory = mi2app_utils.get_cache_dir() # log_directory = os.path.join(cache_directory, "mi2log") src = OfflineReplayer() src.set_input_path(sys.argv[1]) analyzer = UlRLCAnalyzer() analyzer.set_source(src) # analyzer.set_idx(3) src.run() x = [] y = [] for row in analyzer.pdu_pkts: x.append(row[0]) y.append(row[2]) x1 = [] y1 = [] for row in analyzer.pdu_pkts: x1.append(row[1]) y1.append(row[2]) x2 = [] y2 = [] for row in analyzer.receive_buffer_backup: x2.append(row[1]) y2.append(row[0]) x3 = [] y3 = [] for row in analyzer.pdcp_rx: x3.append(row[0]) y3.append(row[1]) total = len(analyzer.receive_buffer_backup) send = len(analyzer.pdu_pkts) analyzer.log_info("Total Recieve Package: " + str(total)) print "Total Recieve Package: " + str(total) # analyzer.log_info("Total Send PDCP Package: " + str(send)) analyzer.log_info("Total Match Package: " + str(analyzer.match)) print "Total Match Package: " + str(analyzer.match) analyzer.log_info("Average wait delay: " + str(analyzer.total_wait_delay/analyzer.match)) print "Average wait delay: " + str(analyzer.total_wait_delay/analyzer.match) analyzer.log_info("Average TX delay: " + str(analyzer.total_tx_delay/analyzer.match)) print "Average TX delay: " + str(analyzer.total_tx_delay/analyzer.match) plt.scatter(x3,y3,s=5, color = 'y', label = 'retransmission') plt.scatter(x2,y2,s=10, color = 'g',label = 'buffer recieve') plt.scatter(x1,y1,s=5, color = 'b', label='pdcp package finish sending') plt.scatter(x,y,s=2,color='r', label='pdcp package start sending') plt.xlabel('Timestamp') plt.ylabel('Package Size') plt.title(sys.argv[1]) plt.legend() plt.show()
# Import MobileInsight modules from mobile_insight.monitor import OfflineReplayer from mobile_insight.analyzer import MsgLogger, LteRrcAnalyzer, WcdmaRrcAnalyzer, LteNasAnalyzer, UmtsNasAnalyzer, LtePhyAnalyzer, LteMacAnalyzer, LtePdcpAnalyzer, LteRlcAnalyzer, LteCustomAnalyzer log_file_location = str(sys.argv[1]) log_folder = os.path.dirname(log_file_location) LOGMSG = False logmsg_filename = str(os.path.basename(log_file_location).split(".")[0]) + "_log.xml" MSGLOGGER = False if __name__ == "__main__": # Initialize a 3G/4G monitor src = OfflineReplayer() src.set_input_path(log_file_location) #src.enable_log_all() if (MSGLOGGER): logger = MsgLogger() logger.set_decode_format(MsgLogger.XML) logger.set_dump_type(MsgLogger.FILE_ONLY) logger.save_decoded_msg_as(log_folder+"/"+logmsg_filename) logger.set_source(src) # Analyzers lte_rrc_analyzer = LteRrcAnalyzer() lte_rrc_analyzer.set_source(src) # bind with the monitor wcdma_rrc_analyzer = WcdmaRrcAnalyzer() wcdma_rrc_analyzer.set_source(src) # bind with the monitor
def parse_qmdl(plainTextFile): # Initialize an OfflineReplayer as monitor src = OfflineReplayer() m = MobilityMisconfigGsmCdmaAnalyzer() for f in get_sorted_logs(plainTextFile): m.reset() m.set_source(src) src.set_input_path(f) # Start the monitoring src.run() gsm_mobility_misconfig_serving_cell_dict = m.get_gsm_mobility_misconfig_serving_cell_dict( ) cdma_mobility_misconfig_serving_cell_dict = m.get_cdma_mobility_misconfig_serving_cell_dict( ) evdo_mobility_misconfig_serving_cell_dict = m.get_evdo_mobility_misconfig_serving_cell_dict( ) filename = str(f) print filename carrier = "Unknown" try: carrier = (filename.split('.mi2log')[0]).split('_')[-1] except: carrier = "Unknown" for CellIdentityCombine, CellInfo in gsm_mobility_misconfig_serving_cell_dict.iteritems( ): CellIdentityCombine = (carrier, ) + CellIdentityCombine print CellIdentityCombine InfoKey = "gsm_cell_information" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "gsm_reselection_parameters" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem print "-----------------------------------------------------------" for CellIdentityCombine, CellInfo in cdma_mobility_misconfig_serving_cell_dict.iteritems( ): CellIdentityCombine = (carrier, ) + CellIdentityCombine print CellIdentityCombine InfoKey = "cdma_paging" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem print "-----------------------------------------------------------" for CellIdentityCombine, CellInfo in evdo_mobility_misconfig_serving_cell_dict.iteritems( ): CellIdentityCombine = (carrier, ) + CellIdentityCombine print CellIdentityCombine InfoKey = "evdo_sector_parameters" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem InfoKey = "evdo_other_rat" if InfoKey in CellInfo: print InfoKey for InfoValueItem in CellInfo[InfoKey]: print InfoValueItem print "-----------------------------------------------------------"
elif (dl_size < ul_size and not (dl_size < 75 and ul_size > 94) ) or (ul_size < 75 and dl_size > 94 and (ul_sfn > dl_sfn or ul_sfn - dl_sfn < -8000)): dl_pointer += 1 else: ul_pointer += 1 print "ul_size, ul_fn_sfn, ul_timestamp, dl_size, dl_fn_sfn, dl_timestamp, first_dl_fn_sfn, dl_trans_delay, e2e_delay" for i in joint_delay: if 0 < i[4] - i[1] < 600: print ','.join(map(str, i + [i[4] - i[1]])) if __name__ == "__main__": if len(sys.argv) != 2: print "Usage python example_pdcp.py [path to mi2log file]" exit() # Initialize a 3G/4G monitor src = OfflineReplayer() src.set_input_path(sys.argv[1]) dumpAnalyzer = DumpAnalyzer() dumpAnalyzer.set_source(src) # Start the monitoring src.run() dumpAnalyzer.post_process()
if a.get("name") == "lte-rrc.message": for b in a: if b.get("name") == "lte-rrc.c1": for c in b.iter("field"): #print c.attrib if c.attrib["name"] == messages[0]: print "Reconfig Start" if c.attrib["name"] == messages[1]: print "Reconfig Complete" if c.attrib["name"] == messages[2]: print "Reconfig Release" if __name__ == "__main__": src = OfflineReplayer() src.set_input_path("./example.mi2log") if not os.path.isfile('./logdump.xml'): dump_logs('./logdump.xml') #with open('./logdump.xml', 'r+') as f: # content = f.read() # f.seek(0, 0) # f.write('<root>\n' + content) #with open('./logdump.xml', 'a+') as f: # f.write('</root>') # f.close() #sleep(60)
if __name__ == "__main__": from mobile_insight.monitor import OfflineReplayer from mobile_insight.analyzer import MsgLogger #from ul_lat_breakdown_analyzer import UlLatBreakdownAnalyzer #from lte_handover_disruption_analyzer import LteHandoverDisruptionAnalyzer #from ul_mac_latency_analyzer import UlMacLatencyAnalyzer #from dl_lat_breakdown_analyzer import DlLatBreakdownAnalyzer import inspect # Initialize a 3G/4G monitor src = OfflineReplayer() #src.set_input_path("./5.qmdl") #src.set_input_path("./att.mi2log") #src.set_input_path("./q.qmdl") src.set_input_path("./VR_sample_log.qmdl") logger = MsgLogger() logger.set_decode_format(MsgLogger.JSON) logger.set_dump_type(MsgLogger.FILE_ONLY) logger.save_decoded_msg_as("./test.txt") logger.set_source(src) alyzer = DlLatBreakdownAnalyzer() alyzer.set_source(src) src.run() #print(alyzer.unmapped_pdcp_rl) #debug_print(alyzer.mapped_pdcp_rlc) #debug_print(alyzer.config_to_pdcp) #debug_print(alyzer.config_to_rlc) #debug_print(alyzer.mapped_all) debug_print(alyzer.kpi)
#Import MobileInsight modules from mobile_insight.monitor import OfflineReplayer from mobile_insight.analyzer import MsgLogger, LteRrcAnalyzer,WcdmaRrcAnalyzer,LteNasAnalyzer,UmtsNasAnalyzer,MmAnalyzer if __name__ == "__main__": # Initialize the 3G/4G monitor for offline analysis. It "replays" the log previously captured path_to_mi2log = './' mi_files = [pos_mi for pos_mi in os.listdir(path_to_mi2log) if pos_mi.endswith('.mi2log')] for index,mi_file in enumerate(mi_files): src = OfflineReplayer() src.set_input_path(mi_file) # Save the decoded messages extracted from the log logger = MsgLogger() logger.set_decode_format(MsgLogger.XML) logger.set_dump_type(MsgLogger.FILE_ONLY) logger.save_decoded_msg_as("./%s.xml" %mi_file) logger.set_source(src) #Analyzers. Use them according to technology in your logs # RRC analyzer for both LTE and UMTS src.enable_log_all() # lte_rrc_analyzer.set_source(src) #bind with the monitor # lte_nas_analyzer = LteNasAnalyzer() # lte_nas_analyzer.set_source(src)