def phout_multi_read(self): with open(self.filename) as f: exp = f.read() errors = [] stop = Event() mr = FileMultiReader(self.filename, stop) threads = [ Thread(target=self.mock_consumer, args=(mr.get_file(i), exp, i, errors), name='Thread-%d' % i) for i in [1000, 4000, 8000] ] [th.start() for th in threads] stop.set() [th.join() for th in threads] mr.close() return errors
def phout_multi_readline(self): errors = [] stop = Event() mr = FileMultiReader(self.filename, stop) threads = [ Thread(target=self.mock_complex_consumer, args=(mr.get_file(i), exp, 10, errors), name='Thread-%d' % i) for i, exp in [(1000, '\n1543699431'), (4000, '815\t0\t200\n1543699487'), (8000, '10968\t3633\t16\t7283\t36\t7387\t1066\t328\t0\t405\n1543699534' )] ] [th.start() for th in threads] stop.set() [th.join() for th in threads] mr.close() return errors
def get_reader(self): if self.reader is None: self.reader = PhantomReader(FileMultiReader(self.phout_filename, self.finished).get_file()) return self.reader
def setup_class(self): stop = Event() self.multireader = FileMultiReader('yandextank/plugins/Phantom/tests/phout.dat', stop) stop.set()
def setup_class(self): stop = Event() self.multireader = FileMultiReader( os.path.join(get_test_path(), 'yandextank/plugins/Phantom/tests/phout.dat'), stop) stop.set()
def setup_class(self): stop = Event() self.multireader = FileMultiReader(os.path.join(PATH, 'phout.dat'), stop) stop.set()