Helper method to crawl through collections in a StoreGateSvc instance and
assess how much memory they are wasting b/c they 'forgot' to reserve
enough space before doing 'push_back'.
This task is performed by just comparing what Klass::size() and
Klass::capacity() are returning as a value.
@param `sgname` the fully qualified Gaudi name of the StoreGateSvc instance
@return a dictionary of { <sgkey> : (size, capacity, clid) }
Definition at line 16 of file PyMonUtils.py.
18 Helper method to crawl through collections in a StoreGateSvc instance and
19 assess how much memory they are wasting b/c they 'forgot' to reserve
20 enough space before doing 'push_back'.
22 This task is performed by just comparing what Klass::size() and
23 Klass::capacity() are returning as a value.
25 @param `sgname` the fully qualified Gaudi name of the StoreGateSvc instance
26 @return a dictionary of { <sgkey> : (size, capacity, clid) }
30 from AthenaPython
import PyAthena
35 sg = PyAthena.py_svc (sgname)
36 cl = PyAthena.py_svc (
'ClassIDSvc')
39 proxies = sg.proxies()
49 klass =
"%s" % cl.typename(clid)
56 data = sg.retrieve(klass, k)
65 if not hasattr(data,
'size')
or \
66 not hasattr(data,
'capacity'):
73 rt = sz/
float(cp)*100.
77 wasted[k] = (sz, cp, clid)