CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
esMonitoring.FDJsonHandler Class Reference
Inheritance diagram for esMonitoring.FDJsonHandler:
esMonitoring.AsyncLineReaderMixin

Public Member Functions

def __init__ (self, sock, es)
 
def handle_line (self, line)
 
def handle_write (self)
 
def writable (self)
 
- Public Member Functions inherited from esMonitoring.AsyncLineReaderMixin
def __init__ (self)
 
def handle_close (self)
 
def handle_line (self)
 
def handle_read (self)
 

Public Attributes

 es
 
- Public Attributes inherited from esMonitoring.AsyncLineReaderMixin
 line_buf
 not needed, since asyncore automatically handles close if len(rbuf) == 0: self.handle_close() return More...
 

Detailed Description

Definition at line 263 of file esMonitoring.py.

Constructor & Destructor Documentation

def esMonitoring.FDJsonHandler.__init__ (   self,
  sock,
  es 
)

Definition at line 264 of file esMonitoring.py.

264  def __init__(self, sock, es):
265  AsyncLineReaderMixin.__init__(self)
266  asyncore.dispatcher.__init__(self, sock)
267 
268  self.es = es
269 
def __init__(self, sock, es)

Member Function Documentation

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 270 of file esMonitoring.py.

References createfilelist.int, and esMonitoring.log().

270  def handle_line(self, line):
271  if len(line) < 4:
272  # keep alive 'ping'
273  self.es.try_update()
274  return
275 
276  try:
277  doc = json.loads(line)
278 
279  for k in ["pid", "run", "lumi"]:
280  if k in doc:
281  doc[k] = int(doc[k])
282 
283  self.es.update_doc_recursive(self.es.doc, doc)
284  self.es.try_update()
285  except:
286  log("cannot deserialize json len: %d content: %s" % (len(line), line))
287 
def handle_line(self, line)
def esMonitoring.FDJsonHandler.handle_write (   self)

Definition at line 288 of file esMonitoring.py.

288  def handle_write(self):
289  pass
290 
def esMonitoring.FDJsonHandler.writable (   self)

Definition at line 291 of file esMonitoring.py.

291  def writable(self):
292  return False
293 

Member Data Documentation

esMonitoring.FDJsonHandler.es

Definition at line 268 of file esMonitoring.py.

Referenced by esMonitoring.FDJsonServer.handle_accept().