def enqueue(cls, req): """Call it to get all the needed params from the logging request. """ widx = cls.FJ_Queue.next_index() logging.info(Dimentions.get_stats(req)) Data(data=json.dumps(Dimentions.get_stats(req)), work_index=widx).put() cls.FJ_Queue.add(widx) return
def calc_req_tag_val(cls, req): "(dimention, (tag,value)) pairs" ph_id = req.get("ph_id") log(json.loads(req.get("data"))) entries = cls.__entry_list(json.loads(req.get("data"))) cats = Dimentions.get_dim_and_met(req, req.get("time")) result = {"aggregate": {}, "timeline": {}} for i in ["aggregate", "timeline"]: res = result[i] stat = cats[i] for c in stat: typ = slashify(ph_id, c[0]) if typ in res: logging.error(" the string should be unique for a single request:" + typ) res[typ] = {c[1]: entries} return result