1
2
3
4
5import isystem.connect as ic
6import export_profiler_data
7
8
9winidea_id = ''
10
11
12def test_hasStatisticsForFunction():
13 conn_mgr = ic.ConnectionMgr()
14 conn_mgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
15
16
17 xml_file_path = export_profiler_data.export_data(conn_mgr)
18 prof_data = ic.CProfilerData2.createInstance(xml_file_path, False)
19
20 area = prof_data.getArea(ic.CProfilerArea2.EFunctions, "targetInit")
21 has_stat = prof_data.hasStatisticsForFunction(area.getAreaId(), "Neutral")
22 print(
23 f"Has statistics for function 'targetInit' in 'Neutral' context (by ID): {has_stat}")
24
25 has_stat = prof_data.hasStatisticsForFunction(ic.CProfilerArea2.EFunctions,
26 "targetInit",
27 "Neutral")
28 print(
29 f"Has statistics for function 'targetInit' in 'Neutral' context (by name): {has_stat}")
30
31
32if __name__ == "__main__":
33 test_hasStatisticsForFunction()