◆ __init__()
def python.PyComps.PyStorePayloadMon.__init__ |
( |
|
self, |
|
|
|
name = 'PyStorePayloadMon' , |
|
|
** |
kw |
|
) |
| |
Definition at line 16 of file Control/PerformanceMonitoring/PerfMonComps/python/PyComps.py.
16 def __init__(self, name='PyStorePayloadMon', **kw):
18 super(PyStorePayloadMon, self).
__init__(name, **kw)
21 self.sg_name = kw.get(
'sg_name',
'StoreGateSvc/StoreGateSvc')
22 """StoreGateSvc instance to monitor for DataProxy payload sizes"""
24 self.oname = kw.get(
'oname',
'pmon_payload.ascii')
25 """Name of the output file where the monitoring data will be stored"""
27 self.display_mall_infos = kw.get(
28 'display_mall_infos',
False)
29 """display mallinfos stats after each event"""
31 import Hephaestus.MemoryTracker
as memtrack
32 from Hephaestus.MemoryTracker
import FreeStatistics
as heph_stats
33 self.heph_stats = heph_stats
35 mask = memtrack.configure()
36 memtrack.configure( mask | memtrack.FREESTAT )
◆ execute()
def python.PyComps.PyStorePayloadMon.execute |
( |
|
self | ) |
|
Definition at line 88 of file Control/PerformanceMonitoring/PerfMonComps/python/PyComps.py.
89 proxies =
list(self.sg.proxies())
94 mem_store_0, ncalls_0 = fs.stat()
95 data = map(self.process_proxy, proxies)
96 mem_store_1, ncalls_1 = fs.stat()
98 clid2name = self.clidsvc.typename
99 fmt =
" (%10i, %10i, %10i, \"%s\", \"%s\"),"
101 print(
" [ ## new-event", file=fd)
102 for p, mem_0, mem_1
in data:
103 tp_name = clid2name(p.clID())
104 print(fmt, (mem_0, mem_1, mem_0 - mem_1, tp_name, p.name()), file=fd)
106 mem_store_0 =
int(mem_store_0)
107 mem_store_1 =
int(mem_store_1)
110 mem_store_0, mem_store_1, mem_store_0 - mem_store_1,
111 "StoreGateSvc", self.sg_name
113 print(
" ],", file=fd)
115 self.msg.
info(
'flush-store: %10d -> %10d -- delta= %10d',
116 mem_store_0, mem_store_1, mem_store_0 - mem_store_1)
117 return StatusCode.Success
◆ finalize() [1/2]
StatusCode PyAthena::Svc::finalize |
( |
| ) |
|
|
overridevirtualinherited |
◆ finalize() [2/2]
def python.PyComps.PyStorePayloadMon.finalize |
( |
|
self | ) |
|
◆ handle() [1/2]
void PyAthena::Svc::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtualinherited |
callback method for the IIncidentSvc
Definition at line 122 of file PyAthenaSvc.cxx.
125 if (0 == PyObject_HasAttrString (
m_self, (
char*)
"handle")) {
132 PyObject *o = TPython::CPPInstance_FromVoidPtr ((
void*)(&inc),
"Incident");
◆ handle() [2/2]
def python.PyComps.PyStorePayloadMon.handle |
( |
|
self, |
|
|
|
incident |
|
) |
| |
◆ initialize() [1/2]
StatusCode PyAthena::Svc::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ initialize() [2/2]
def python.PyComps.PyStorePayloadMon.initialize |
( |
|
self | ) |
|
Definition at line 39 of file Control/PerformanceMonitoring/PerfMonComps/python/PyComps.py.
40 self.msg.
info(
'==> initialize...')
41 self.sg = PyAthena.py_svc(self.sg_name)
43 self.msg.
error(
'could not retrieve sg instance [%s]', self.sg_name)
44 return StatusCode.Failure
46 ns = PyAthena.AthenaInternal
47 self._sg_clear = ns.py_sg_clearProxyPayload
49 self.clidsvc = PyAthena.py_svc(
'ClassIDSvc/ClassIDSvc',
52 self.msg.
error(
'could not retrieve clidsvc')
53 return StatusCode.Failure
55 self.heph_stats.
start()
59 if os.path.exists(self.oname):
61 self.ostream =
open(self.oname,
'w')
64 print(
"#data format: [[(bytes_0, bytes_1, delta, clid, sg_key),]]", file=self.ostream)
65 print(
"data = [", file=self.ostream)
68 incsvc = PyAthena.py_svc(
'IncidentSvc', iface=
'IIncidentSvc')
69 incsvc.addListener(self,
'BeginEvent')
70 incsvc.addListener(self,
'EndEvent')
72 return StatusCode.Success
◆ process_proxy()
def python.PyComps.PyStorePayloadMon.process_proxy |
( |
|
self, |
|
|
|
p |
|
) |
| |
◆ reinitialize()
StatusCode PyAthena::Svc::reinitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ self()
virtual PyObject* PyAthena::Svc::self |
( |
| ) |
|
|
inlineoverridevirtualinherited |
return associated python object.
BORROWED reference.
Definition at line 68 of file PyAthenaSvc.h.
◆ setPyAttr()
bool PyAthena::Svc::setPyAttr |
( |
PyObject * |
pyobj | ) |
|
|
overrideprotectedvirtualinherited |
attach the C++ component to its python cousin
Definition at line 154 of file PyAthenaSvc.cxx.
158 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
163 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Svc");
165 (
"could not dyncast component [" <<
name() <<
"] to a python "
166 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
167 <<
"dictionary)" <<
endmsg
168 <<
"fallback to [PyAthena::Svc]...");
173 (
"Could not dyncast component [" <<
name() <<
"] to a pyobject of type ["
176 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
179 (
"Could not attach C++ handle [" <<
name() <<
"] to its python "
181 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
184 (
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
185 <<
"python cousin !");
◆ start()
StatusCode PyAthena::Svc::start |
( |
| ) |
|
|
overridevirtualinherited |
◆ stop()
StatusCode PyAthena::Svc::stop |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysInitialize()
StatusCode PyAthena::Svc::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 90 of file PyAthenaSvc.cxx.
93 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
94 if ( !pyMgr.retrieve().isSuccess() ) {
96 (
"Could not retrieve service [" << pyMgr.typeAndName() <<
"] !!");
97 return StatusCode::FAILURE;
101 m_self = pyMgr->pyObject(
this );
103 if (
m_self == Py_None ) {
105 return StatusCode::FAILURE;
109 return SvcBase_t::sysInitialize();
◆ typeName()
const char * PyAthena::Svc::typeName |
( |
| ) |
const |
|
overrideinherited |
return the std::type_info
name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part
Definition at line 114 of file PyAthenaSvc.cxx.
116 static const std::string tname = System::typeinfoName(
typeid(*
this));
117 return tname.c_str();
◆ _sg_clear
python.PyComps.PyStorePayloadMon._sg_clear |
|
private |
◆ clidsvc
python.PyComps.PyStorePayloadMon.clidsvc |
◆ display_mall_infos
python.PyComps.PyStorePayloadMon.display_mall_infos |
◆ heph_stats
python.PyComps.PyStorePayloadMon.heph_stats |
◆ m_self
Pointer to self (from the python world)
Definition at line 89 of file PyAthenaSvc.h.
◆ oname
python.PyComps.PyStorePayloadMon.oname |
◆ ostream
python.PyComps.PyStorePayloadMon.ostream |
◆ sg
python.PyComps.PyStorePayloadMon.sg |
◆ sg_name
python.PyComps.PyStorePayloadMon.sg_name |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.