Cách mở đường dẫn tệp trong javascript
open() thường tiêu tốn một lượng lớn bộ nhớ vì mỗi VU giữ một bản sao riêng của tệp trong bộ nhớ. Để giảm mức tiêu thụ bộ nhớ, chúng tôi thực sự khuyên bạn nên sử dụng SharedArray cho CSV, JSON và các tệp khác dành cho tham số hóa tập lệnh Show
ParameterTypeDescriptionfilePathstringThe path to the file, absolute or relative, that will be read into memory. The file will only be loaded once, even when running with several VUs. modestringBy default, the contents of the file are read as text, but if you specify b, the file will be read as binary data instead ReturnsTypeDescriptionstring / ArrayBufferThe contents of the file, returned as string or ArrayBuffer (if b was specified as the mode)
|