Exemple #1
0
    def get_events_per_dotted(self,
                              attribute1,
                              attribute2,
                              attribute3,
                              parameters=None):
        if parameters is None:
            parameters = {}
        list_logs = self.get_list_logs()
        for key in self.init_parameters:
            if key not in parameters:
                parameters[key] = self.init_parameters[key]
        parameters["filters"] = self.filters
        parameters["attribute1"] = attribute1
        parameters["attribute2"] = attribute2
        parameters["attribute3"] = attribute3

        ret = parquet_handler.get_events_per_dotted(".",
                                                    self.distr_log_path,
                                                    list_logs,
                                                    parameters=parameters)

        return {
            "traces": ret[0],
            "types": ret[1],
            "attributes": ret[2],
            "third_unique_values": ret[3]
        }
Exemple #2
0
def get_events_per_dotted():
    try:
        process = request.args.get('process', type=str)
        keyphrase = request.args.get('keyphrase', type=str)
        session = request.args.get('session', type=str)

        use_transition = request.args.get(PARAMETER_USE_TRANSITION,
                                          type=str,
                                          default=str(DEFAULT_USE_TRANSITION))
        no_samples = request.args.get(PARAMETER_NO_SAMPLES,
                                      type=int,
                                      default=DEFAULT_MAX_NO_SAMPLES)
        attribute1 = request.args.get("attribute1", type=str)
        attribute2 = request.args.get("attribute2", type=str)
        attribute3 = request.args.get("attribute3", type=str, default=None)
        max_no_ret_items = request.args.get(PARAMETER_NUM_RET_ITEMS,
                                            type=int,
                                            default=10000)

        if use_transition == "True":
            use_transition = True
        else:
            use_transition = False

        if keyphrase == configuration.KEYPHRASE:
            filters = get_filters_per_session(process, session)
            parameters = {}
            parameters["filters"] = filters
            parameters[PARAMETER_USE_TRANSITION] = use_transition
            parameters[PARAMETER_NO_SAMPLES] = no_samples
            parameters["attribute1"] = attribute1
            parameters["attribute2"] = attribute2
            parameters["attribute3"] = attribute3
            parameters["max_no_events"] = max_no_ret_items

            returned_dict = parquet_handler.get_events_per_dotted(
                SlaveVariableContainer.conf,
                process,
                SlaveVariableContainer.managed_logs[process],
                parameters=parameters)

            return jsonify(returned_dict)
        return jsonify({})
    except:
        return traceback.format_exc()