Exemplo n.º 1
0
    def log_goal(self, goal_name, extra=None):

        request_info = GoalRecord.extract_request_info(self.request)

        self.enqueue("log_goal", {"goal_name": goal_name,
                                   "request_info": request_info,
                                   "extra": extra})
Exemplo n.º 2
0
    def log_goal(self, goal_name, extra=None):
        request_info = GoalRecord.extract_request_info(self.request)

        self.enqueue("log_goal", {
            "goal_name": goal_name,
            "request_info": request_info,
            "extra": extra
        })
Exemplo n.º 3
0
    def process_from_queue(self, action, params):
        if action == "enroll":
            exp = Experiment.objects.get(name=params["exp_name"])
            exp.enroll_subject_as_variant(self.get_subject(),
                                          params["variant"])

        elif action == "log_goal":
            g = GoalRecord.record(self.get_subject(),
                                  params["goal_name"],
                                  params["request_info"],
                                  extra=params.get("extra"))
        else:
            raise RuntimeError("Unknown queue action '%s'." % action)
Exemplo n.º 4
0
    def process_from_queue(self, action, params):
        logger.info("dequeued: %s (%s)" % (str(action), repr(params)))

        if action == "enroll":
            exp = Experiment.objects.get(name=params["exp_name"])
            exp.enroll_user_as_variant(self.request.user, params["variant"])

        elif action == "log_goal":
            g = GoalRecord.record(self.request.user,
                                  params["goal_name"],
                                  params["request_info"],
                                  extra=params.get("extra"))

            logger.info("goal! %s" % str(g))

        else:
            raise RuntimeError("Unknown queue action '%s'." % action)
Exemplo n.º 5
0
    def process_from_queue(self, action, params):
        logger.info("dequeued: %s (%s)" % (str(action), repr(params)))

        if action == "enroll":
            exp = Experiment.objects.get(name=params["exp_name"])
            exp.enroll_user_as_variant(self.request.user,
                                          params["variant"])

        elif action == "log_goal":
            g = GoalRecord.record(self.request.user, 
                                  params["goal_name"], 
                                  params["request_info"],
                                  extra=params.get("extra"))

            logger.info("goal! %s" % str(g))


        else:
            raise RuntimeError("Unknown queue action '%s'." % action)