5import isystem.connect
as ic
6import export_profiler_data
12def test_getStatistics():
13 conn_mgr = ic.ConnectionMgr()
14 conn_mgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17 xml_file_path = export_profiler_data.export_data(conn_mgr)
18 prof_data = ic.CProfilerData2.createInstance(xml_file_path,
False)
20 print(
"Function 'targetInit' statistics:")
21 area = prof_data.getArea(ic.CProfilerArea2.EFunctions,
"targetInit")
22 stat = prof_data.getStatistics(area.getAreaId())
23 print(f
"\tArea name: {stat.getAreaName()}")
24 print(f
"\tCall count: {stat.getNumHits()}")
25 print(f
"\tCall time: {stat.getTotalTime(ic.CProfilerStatistics2.ECallTimes)}")
27 print(
"State variable 'Data/(g_baseStruct).i_base' statistics:")
28 stat = prof_data.getStatistics(
'Data/(g_baseStruct).i_base', 0x2A)
29 print(f
"\tArea name: {stat.getParentAreaName()}")
30 print(f
"\tState name: {stat.getAreaName()}")
33if __name__ ==
"__main__":