7 """ A container of flags for Performance Monitoring
12 __author__ =
'Sebastien Binet'
13 __version__ =
"$Revision: 1.17 $"
14 __doc__ =
"A container of flags for Performance Monitoring"
16 from AthenaCommon.JobProperties
import JobProperty, JobPropertyContainer
17 from AthenaCommon.JobProperties
import jobproperties
21 """Flag to active the MT-safe monitoring framework and service(s)
22 It of course deactives serial monitoring
25 allowedTypes = [
'bool']
29 from AthenaCommon.AppMgr
import ServiceMgr
as svcMgr
30 if not hasattr(svcMgr,
'PerfMonMTSvc'):
31 from PerfMonComps.MTJobOptCfg
import PerfMonMTSvc
37 from AthenaCommon.AppMgr
import ServiceMgr
as svcMgr
39 if hasattr(svcMgr,
'PerfMonMTSvc'):
40 del svcMgr.PerfMonMTSvc
44 """ Flag to active fast MT-safe monitoring framework and service(s)
45 It also activates the doMonitoringMT flag
48 allowedTypes = [
'bool']
51 jobproperties.PerfMonFlags.doMonitoringMT =
True
56 """ Flag to activate full MT-safe monitoring framework and service(s)
57 It also activate the doMonitoringMT flag
58 Note that due to locks this functionality might negatively impact
62 allowedTypes = [
'bool']
65 jobproperties.PerfMonFlags.doMonitoringMT =
True
70 """ Flag to override the default output file name of the perfmonmt json
73 allowedTypes = [
'str']
74 StoredValue =
"perfmonmt.json"
78 """ The global performance monitoring flag/job property container.
83 jobproperties.add_Container(PerfMonFlags)
87 list_jobproperties = [
94 for i
in list_jobproperties:
95 jobproperties.PerfMonFlags.add_JobProperty(i)
98 del list_jobproperties
102 """helper function to decode athena-command-line options.
104 @param opts is a list of options which can enable or disable a few
105 jobproperties.PerfMonFlags fields
107 @param dry_run to only decode but not set the options
109 one activates a perfmon flag by prepending '+' in front of the option name
110 (or nothing prepended, '+' being the implied default)
111 and de-activates it by prepending '-'.
113 pmf = jobproperties.PerfMonFlags
115 'perfmonmt': pmf.doMonitoringMT,
116 'fastmonmt': pmf.doFastMonMT,
117 'fullmonmt': pmf.doFullMonMT,
123 if opt.startswith(
'-'):
125 flag_name = flag_name[1:]
126 elif opt.startswith(
'+'):
128 flag_name = flag_name[1:]
129 if flag_name
not in dispatch:
131 '[%s] is not a valid PerfMonFlag (allowed: %r)' %
132 (flag_name,
list(dispatch.keys()))
136 dispatch[flag_name].set_Value(val)