in qpid/managementdata.py [0:0]
def dataHandler (self, context, className, list, timestamps):
""" Callback for configuration and instrumentation data updates """
self.lock.acquire ()
try:
# If this class has not been seen before, create an empty dictionary to
# hold objects of this class
if className not in self.tables:
self.tables[className] = {}
# Register the ID so a more friendly presentation can be displayed
objId = list[0][1]
oidx = objId.index()
self.registerObjId (objId)
# If this object hasn't been seen before, create a new object record with
# the timestamps and empty lists for configuration and instrumentation data.
if oidx not in self.tables[className]:
self.tables[className][oidx] = (timestamps, [], [])
(unused, oldConf, oldInst) = self.tables[className][oidx]
# For config updates, simply replace old config list with the new one.
if context == 0: #config
self.tables[className][oidx] = (timestamps, list, oldInst)
# For instrumentation updates, carry the minimum and maximum values for
# "hi-lo" stats forward.
elif context == 1: #inst
if len (oldInst) == 0:
newInst = list
else:
newInst = []
for idx in range (len (list)):
(key, value) = list[idx]
if key.find ("High") == len (key) - 4:
if oldInst[idx][1] > value:
value = oldInst[idx][1]
if key.find ("Low") == len (key) - 3:
if oldInst[idx][1] < value:
value = oldInst[idx][1]
newInst.append ((key, value))
self.tables[className][oidx] = (timestamps, oldConf, newInst)
finally:
self.lock.release ()