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 264 of file esMonitoring.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 265 of file esMonitoring.py.

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

Member Function Documentation

◆ handle_line()

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 271 of file esMonitoring.py.

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

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

◆ handle_write()

def esMonitoring.FDJsonHandler.handle_write (   self)

Definition at line 289 of file esMonitoring.py.

289  def handle_write(self):
290  pass
291 

◆ writable()

def esMonitoring.FDJsonHandler.writable (   self)

Definition at line 292 of file esMonitoring.py.

292  def writable(self):
293  return False
294 

Member Data Documentation

◆ es

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