从 Gatling 进纸器加载更多记录
Load more records from Gatling feeder
我想将我的 csv 文件中的 n 行注入 Gatling 进纸器。 Gatling 的默认方法是一次读取和注入一行。但是,我无法在任何地方找到如何服用和注射 eg。数组成模板。
我想到了创建一个 JSON 模板,并将 Gatling 表达式作为其中的一些字段。问题是我有一个包含 N 个元素的 JSON 数组:
[
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...}
]
还有我的 csv:
value,value2,...
value,value2,...
value,value2,...
value,value2,...
...
我想让它尽可能高效。我的数据在 CSV 文件中,所以我想使用 csv
馈线。另外,尺寸很大,所以 readRecords
是不可能的,因为我的内存不足。
有没有一种方法可以使用 Gatling 将 N 条记录放入请求正文中?
Note
You can also feed multiple records all at once. If so, attribute names, will be suffixed. For example, if the columns are name “foo” and “bar” and you’re feeding 2 records at once, you’ll get “foo1”, “bar1”, “foo2” and “bar2” session attributes.
feed(feeder, 2)
我想将我的 csv 文件中的 n 行注入 Gatling 进纸器。 Gatling 的默认方法是一次读取和注入一行。但是,我无法在任何地方找到如何服用和注射 eg。数组成模板。
我想到了创建一个 JSON 模板,并将 Gatling 表达式作为其中的一些字段。问题是我有一个包含 N 个元素的 JSON 数组:
[
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...},
{"myKey": ${value}, "mySecondKey": ${value2}, ...}
]
还有我的 csv:
value,value2,...
value,value2,...
value,value2,...
value,value2,...
...
我想让它尽可能高效。我的数据在 CSV 文件中,所以我想使用 csv
馈线。另外,尺寸很大,所以 readRecords
是不可能的,因为我的内存不足。
有没有一种方法可以使用 Gatling 将 N 条记录放入请求正文中?
Note
You can also feed multiple records all at once. If so, attribute names, will be suffixed. For example, if the columns are name “foo” and “bar” and you’re feeding 2 records at once, you’ll get “foo1”, “bar1”, “foo2” and “bar2” session attributes.
feed(feeder, 2)