k6 extension to test and benchmark FrostFS related protocols.
265545a584
Signed-off-by: Denis Kirillov <denis@nspcc.ru> |
||
---|---|---|
.github | ||
examples | ||
internal | ||
go.mod | ||
go.sum | ||
LICENSE | ||
neofs.go | ||
README.md |
k6 extension to test and benchmark NeoFS related protocols.
xk6-neofs
Build
To build a k6
binary with this extension, first ensure you have the prerequisites:
- Go
- Git
- Install
xk6
framework for extendingk6
:
go install go.k6.io/xk6/cmd/xk6@latest
- Clone this repository
git clone github.com/nspcc-dev/xk6-neofs
cd xk6-neofs
- Build the binary:
xk6 build --with github.com/nspcc-dev/xk6-neofs=.
- 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 neofs_cli = native.connect("s01.neofs.devenv:8080", "")
Methods
setBufferSize(size)
. Sets internal buffer size for data upload and download. Default is 64 KiB.put(container_id, headers, payload)
. Returns dictionary withsuccess
boolean flag,object_id
string, anderror
string.get(container_id, object_id)
. Returns dictionary withsuccess
boolean flag, anderror
string.onsite(container_id, payload)
. Returns NeoFS object instance with prepared headers. Invokeput(headers)
method on this object to upload it into NeoFS. It returns dicrionary withsuccess
boolean flag,object_id
string anderror
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 s3_cli = s3.connect("http://s3.neofs.devenv:8080")
Methods
put(bucket, key, payload)
. Returns dictionary withsuccess
boolean flag anderror
string.get(bucket, key)
. Returns dictionary withsuccess
boolean flag anderror
string.
Examples
See native protocol and s3 test suit examples in examples dir.