5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaCommon.Logging
import logging
11 """ Configuring PerfMonMTSvc """
14 log = logging.getLogger(
"PerfMonMTSvcCfg")
15 log.info(
"Configuring PerfMonMTSvc with flags:")
16 log.info(
" >> doFastMonMT {}".
format(flags.PerfMon.doFastMonMT))
17 log.info(
" >> doFullMonMT {}".
format(flags.PerfMon.doFullMonMT))
20 if not flags.PerfMon.doFastMonMT
and not flags.PerfMon.doFullMonMT:
21 log.info(
"Nothing to be done...")
25 PerfMonMTSvc = CompFactory.PerfMonMTSvc
29 kwargs.setdefault(
"wallTimeOffset",
30 psutil.Process(os.getpid()).create_time() * 1000)
31 kwargs.setdefault(
"numberOfThreads",
32 max(1,flags.Concurrency.NumThreads))
33 kwargs.setdefault(
"numberOfSlots",
34 max(1,flags.Concurrency.NumConcurrentEvents))
35 kwargs.setdefault(
"doComponentLevelMonitoring",
36 flags.PerfMon.doFullMonMT)
37 kwargs.setdefault(
"jsonFileName", flags.PerfMon.OutputJSON)
44 acc.addService(CompFactory.AuditorSvc(), create=
True)
45 acc.setAppProperty(
"AuditAlgorithms",
True)
46 acc.setAppProperty(
"AuditTools",
True)
47 acc.setAppProperty(
"AuditServices",
True)
53 if __name__ ==
'__main__':
56 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
57 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
62 flags.Exec.MaxEvents = 100
63 flags.Concurrency.NumThreads = 1
64 flags.PerfMon.doFastMonMT =
True
65 flags.PerfMon.OutputJSON =
'perfmonmt_test.json'
74 CpuCruncherAlg = CompFactory.getComp(
'PerfMonTest::CpuCruncherAlg')
75 cfg.addEventAlgo(
CpuCruncherAlg(
'CpuCruncherAlg', MeanCpu = 100, RmsCpu = 1), sequenceName =
'AthAlgSeq')
78 LeakyAlg = CompFactory.getComp(
'PerfMonTest::LeakyAlg')
79 cfg.addEventAlgo(
LeakyAlg(
"LeakyAlg", LeakSize = 10000), sequenceName =
'AthAlgSeq')
82 cfg.printConfig(withDetails =
True, summariseProps =
True)
90 sys.exit(
not sc.isSuccess())