MyGit

v0.34.0

grafana/k6

版本发布时间: 2021-09-09 19:17:58

grafana/k6最新发布版本:v0.54.0(2024-09-30 17:50:44)

k6 v0.34.0 is here! :tada: It introduces the already announced k6/execution API and includes some more enhancements and a bunch of minor bug fixes.

New k6 JavaScript API - k6/execution

The k6/execution module allows the fetching of information about the current VU, instance (mostly relevant in distributed/cloud) or scenario execution state through a series of exported properties.

How to use

Some of the previously suggested solutions with the globally available __VU and __ITER values, such as for getting a unique object per iteration from an array or SharedArray, can be done by using the scenario.iterationInTest property, which is guaranteed to be unique across VUs, even for distributed or cloud tests. For example:

import exec from "k6/execution";
import { SharedArray } from "k6/data";

const data = new SharedArray("my dataset", function(){
  return JSON.parse(open('my-large-dataset.json'));
})

export const options = {
  scenarios :{
    "use-all-the-data": {
      executor: "shared-iterations",
      vus: 100,
      iterations: data.length,
      maxDuration: "1h"
    }
  }
}

export default function() {
  // this is unique even in the cloud
  var item = data[exec.scenario.iterationInTest];
  http.post("https://httpbin.test.k6.io/anything?endpoint=amazing", item)
}

You can read the full documentation here.

Enhancements and UX improvements

Breaking changes

Bugs fixed!

Internals

相关地址:原始地址 下载(tar) 下载(zip)

1、 k6-v0.34.0-checksums.txt 754B

2、 k6-v0.34.0-linux-amd64.deb 12.77MB

3、 k6-v0.34.0-linux-amd64.rpm 8.94MB

4、 k6-v0.34.0-linux-amd64.tar.gz 15.18MB

5、 k6-v0.34.0-linux-arm64.tar.gz 14.25MB

6、 k6-v0.34.0-macos-amd64.zip 14.89MB

7、 k6-v0.34.0-macos-arm64.zip 14.66MB

8、 k6-v0.34.0-windows-amd64.msi 15.7MB

9、 k6-v0.34.0-windows-amd64.zip 15.3MB

查看:2021-09-09发行的版本