加特林的馈线策略

时间:2021-02-26 11:28:02

标签: scala gatling

我只是尝试实施以下策略来从 Gatling 的 CSV 馈送器中提供值。

  1. val csvFeeder = csv("data/Pet1.csv").batch.circular
  2. val csvFeeder = csv("data/Pet1.csv").circular

两者似乎都工作正常。我们什么时候在 Gatling 中使用“.batch.circular”而不是“.circular”作为喂食策略。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

请阅读documentation,了解默认自适应、const isArrayIndex = (prop: PropertyKey): prop is number => { const index = Number(prop); return Number.isNaN(index) === false && Number.isInteger(index) && index >= 0; } class Grid { private _arr: number[][] = [[19, 27], [33, 4]]; constructor() { const handler: ProxyHandler<Grid> = { get(target, prop, receiver) { if (isArrayIndex(prop)) { return target._arr[prop]; } return Reflect.get(target, prop, receiver); } } return new Proxy(this, handler); } [i: number]: number[]; // ... } const grid = new Grid(); console.log(grid[0][0]); // prints 19; eager Feeder 加载模式之间的差异。