We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class CSVDictReader(Iterator[Dict]):
def __init__(self, file, **kwargs): try: file = open(file) except TypeError: pass self.file = file self.reader = csv.DictReader(file, **kwargs) def __next__(self): try: return next(self.reader) except StopIteration: self.file.seek(0, 0) next(self.reader) return next(self.reader)
当我使用单机分布式 读取csv 文件, 会出现csv数据读取不到的现象, csv的文件大小5MB左右
The text was updated successfully, but these errors were encountered:
When I read the csv file using a single machine distributed, the phenomenon that the csv data cannot be read, the size of the csv file is about 5MB
Sorry, something went wrong.
from locust_plugins.csvreader import CSVDictReader from locust import HttpUser, task
ssn_reader = CSVDictReader("ssn.csv")
class MyUser(HttpUser): @task def index(self): customer = next(ssn_reader) print(customer) self.client.get(f"/?ssn={customer[0]}")
host = "http://example.com" when i use locust -f locustfile.py --processes -1 start this ssn_reader content is error
No branches or pull requests
class CSVDictReader(Iterator[Dict]):
当我使用单机分布式 读取csv 文件, 会出现csv数据读取不到的现象, csv的文件大小5MB左右
The text was updated successfully, but these errors were encountered: