def processlist(**connection_args):
 ret = []
 dbc = _connect(**connection_args)
 if (dbc is None):
  return []
 cur = dbc.cursor()
 _execute(cur, 'SHOW FULL PROCESSLIST')
 hdr = [c[0] for c in cur.description]
 for _ in range(cur.rowcount):
  row = cur.fetchone()
  idx_r = {}
  for idx_j in range(len(hdr)):
   idx_r[hdr[idx_j]] = row[idx_j]
  ret.append(idx_r)
 cur.close()
 return ret

def processlist ( ** connection_args ) : ret = [ ] dbc = _connect ( ** connection_args ) if ( dbc is None ) : return [ ] cur = dbc . cursor ( ) _execute ( cur , 'SHOW FULL PROCESSLIST' ) hdr = [ c [ 0 ] for c in cur . description ] for _ in range ( cur . rowcount ) : row = cur . fetchone ( ) idx_r = { } for idx_j in range ( len ( hdr ) ) : idx_r [ hdr [ idx_j ] ] = row [ idx_j ] ret . append ( idx_r ) cur . close ( ) return ret
retrieves the processlist from the mysql server via "show full processlist" .