test(load): avoid unnecessary new Uint8Array(...) (#414)
* test(load): avoid unnecessary new Uint8Array(...) * Switch to 'k6/websockets'
This commit is contained in:
parent
d924781481
commit
bb02c4fd91
|
|
@ -1,6 +1,6 @@
|
|||
import {check} from 'k6';
|
||||
import http from 'k6/http';
|
||||
import {WebSocket} from 'k6/experimental/websockets';
|
||||
import {WebSocket} from 'k6/websockets';
|
||||
import crypto from 'k6/crypto';
|
||||
import encoding from 'k6/encoding';
|
||||
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.6.0/index.js';
|
||||
|
|
@ -74,7 +74,7 @@ async function portForward(vmName) {
|
|||
});
|
||||
ws.binaryType = 'arraybuffer';
|
||||
|
||||
const sentBytes = new Uint8Array(crypto.randomBytes(WS_BYTES));
|
||||
const sentBytes = crypto.randomBytes(WS_BYTES);
|
||||
const sentHash = crypto.sha256(sentBytes, 'hex');
|
||||
let numReceivedBytes = 0;
|
||||
const receivedHasher = crypto.createHash('sha256');
|
||||
|
|
|
|||
Loading…
Reference in New Issue