Пример #1
0
def test():
    config = {
        'ftp': {
            'type': 1,
            'host': '61.147.114.73',
            'port': 21,
            'user': '******',
            'passwd': '123456x',
            'timeout': 5,
            'local': './'
        }
    }

    analysis_engine = AnalysisEngine(config)
    file_list = analysis_engine.input_data('~/text_storage/60006bak')
    i = 0
    count = len(file_list)
    while i < count:
        tlist = file_list[i:i + 4]
        i += 5
        start_time = time.time()
        for t in tlist:
            analysis_engine.process_file_data(60006, '~/text_storage/60006bak',
                                              t, 0)
        end_time = time.time()
        mlog.log().info("analysis file count %d  expend %d", i,
                        end_time - start_time)
Пример #2
0
def run(console):
    analysis_engine = AnalysisEngine()
    file_list = analysis_engine.input_data(console.path)
    i = 0
    count = len(file_list)
    while i < count:
        tlist = file_list[i:i + 4]
        i += 5
        start_time = time.time()
        for t in tlist:
            analysis_engine.process_file_data(console.plt_id, console.path, t,
                                              0)
        end_time = time.time()
        mlog.log().info("analysis file count %d  expend %d", i,
                        end_time - start_time)
Пример #3
0
def parser_ftp_method(config, path, pid):
    ae = AnalysisEngine(config)
    ae.start()
    file_list = ae.input_data(path)
    i = 0
    count = len(file_list)
    while i < count:
        unit_list = file_list[i:i + 5]
        i += 5
        start_time = time.time()
        for t in unit_list:
            ae.process_file_data(pid, path, t, 0)
        end_time = time.time()
        mlog.log().info("analysis file count %d  expend %d", i,
                        end_time - start_time)