Пример #1
0
def get_edict(conf, top_dt, end_dt, dur, area):
    ld = log_db.LogData(conf)
    edict, evmap = log2event.log2event(conf, ld, top_dt, end_dt, area)

    usefilter = conf.getboolean("dag", "usefilter")
    if usefilter:
        act = conf.get("filter", "action")
        if act == "remove":
            edict, evmap = log2event.filter_edict(conf, edict, evmap,
                    ld, top_dt, end_dt, area)
        elif act == "replace":
            edict, evmap = log2event.replace_edict(conf, edict, evmap,
                    ld, top_dt, end_dt, area)
        else:
            raise NotImplementedError

    return edict, evmap
Пример #2
0
def pc_log(conf, top_dt, end_dt, dur, area):

    _logger.info("job start ({0} - {1} in {2})".format(top_dt, end_dt, area))

    edict, evmap = log2event.log2event(conf, top_dt, end_dt, dur, area)
    _logger.info("{0} events found in given term of log data".format(
            len(edict)))

    if len(edict) > 2:
        threshold = conf.getfloat("dag", "threshold")
        graph = pc_input.pc(edict, threshold)
    else:
        _logger.info("insufficient events({0}), return empty dag".format(\
                len(edict)))
        graph = pc_input.empty_dag()

    output = pcresult.PCOutput(conf)
    output.make(graph, evmap, top_dt, end_dt, dur, area)
    output.dump()
    _logger.info("job done, output {0}".format(output.filename))
    return output
Пример #3
0
def pc_log(conf, top_dt, end_dt, dur, area):

    _logger.info("job start ({0} - {1} in {2})".format(top_dt, end_dt, area))

    edict, evmap = log2event.log2event(conf, top_dt, end_dt, dur, area)
    _logger.info("{0} events found in given term of log data".format(
        len(edict)))

    if len(edict) > 2:
        threshold = conf.getfloat("dag", "threshold")
        graph = pc_input.pc(edict, threshold)
    else:
        _logger.info("insufficient events({0}), return empty dag".format(\
                len(edict)))
        graph = pc_input.empty_dag()

    output = pcresult.PCOutput(conf)
    output.make(graph, evmap, top_dt, end_dt, dur, area)
    output.dump()
    _logger.info("job done, output {0}".format(output.filename))
    return output