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

◆ __init__()

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 

Member Function Documentation

◆ handle_line()

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 270 of file esMonitoring.py.

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 

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

◆ handle_write()

def esMonitoring.FDJsonHandler.handle_write (   self)

Definition at line 288 of file esMonitoring.py.

288  def handle_write(self):
289  pass
290 

◆ writable()

def esMonitoring.FDJsonHandler.writable (   self)

Definition at line 291 of file esMonitoring.py.

291  def writable(self):
292  return False
293 

Member Data Documentation

◆ es

esMonitoring.FDJsonHandler.es
esMonitoring.log
def log(s)
Definition: esMonitoring.py:11
createfilelist.int
int
Definition: createfilelist.py:10