k6 extension to test and benchmark FrostFS related protocols.
Find a file
Alex Vanin 1c0abb2479 [#5] Avoid payload copy in put methods
With goja.ArrayBuffer type VU won't perform
copy operation during every put invocation.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2022-05-20 14:33:56 +03:00
examples [#5] Avoid payload copy in put methods 2022-05-20 14:33:56 +03:00
internal [#5] Avoid payload copy in put methods 2022-05-20 14:33:56 +03:00
go.mod Initial commit 2022-05-12 23:27:06 +03:00
go.sum Initial commit 2022-05-12 23:27:06 +03:00
neofs.go Initial commit 2022-05-12 23:27:06 +03:00
README.md [#4] Update README 2022-05-20 14:10:53 +03:00

xk6-neofs

This is a k6 extension using the xk6 system, that allows to test NeoFS related protocols.

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

  • Go
  • Git
  1. Install xk6 framework for extending k6:
go install go.k6.io/xk6/cmd/xk6@latest
  1. Clone this repository
git clone github.com/nspcc-dev/xk6-neofs
cd xk6-neofs
  1. Build the binary:
xk6 build --with github.com/nspcc-dev/xk6-neofs=.
  1. Run k6:
./k6 run test-script.js

API

Native

Create native client with connect method. Arguments:

  • neofs storage node endpoint
  • WIF (empty value produces random key)
import native from 'k6/x/neofs/native';
const neofsCli = native.connect("s01.neofs.devenv:8080", "")

Methods

  • put(container_id, headers, payload). Returns dictionary with success boolean flag, object_id string, and error string.
  • get(container_id, object_id). Returns dictionary with success boolean flag, and error string.

S3

Create s3 client with connect method. Arguments:

  • s3 gateway endpoint

Credentials are taken from default AWS configuration files and ENVs.

import s3 from 'k6/x/neofs/s3';
const s3cli = s3.connect("http://s3.neofs.devenv:8080")

Methods

  • put(bucket, key, payload). Returns dictionary with success boolean flag and error string.
  • get(bucket, key). Returns dictionary with success boolean flag and error string.

Examples

See native protocol and s3 test suit examples in examples dir.