def progress(archive_id, rec_no, start_pos, pos): global t_prev, load_count cur_time = time() t = cur_time - t_prev t_prev = cur_time t1 = cur_time - t0 rec_per_sec = chunk / t bytes_per_sec_total = (pos - start_pos) / t1 q = { 'chunk': chunk, 'rec_no': rec_no, 't': t, 't1': t1, 'part': part, 'pos': pos, 'load_count': load_count, 'time': cur_time, 'bytes_per_sec_total': bytes_per_sec_total, } pool.post_progress(archive_id, q)