k6 extension to test and benchmark FrostFS related protocols.
 
 
 
 
Go to file
Andrey Berezin 614bee3581 [#19] Add json output for k6 scenarios
This is required for autotests to be able to parse summaries and do checks

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
2023-03-01 15:12:23 +03:00
.github [TrueCloudLab#17] .github: Fix CODEOWNERS 2023-02-28 16:37:04 +03:00
examples [#50] Use `native.connect` timeouts everywhere 2023-02-03 17:12:26 +03:00
internal [#9] logging: Make logger more functional 2023-02-28 14:18:53 +03:00
scenarios [#19] Add json output for k6 scenarios 2023-03-01 15:12:23 +03:00
.gitignore [#30] gitignore: Add dir for presets 2022-11-03 13:11:50 +03:00
CONTRIBUTING.md [#2] Deep rebranding 2022-12-30 11:05:20 +03:00
LICENSE
README.md [#50] Use `native.connect` timeouts everywhere 2023-02-03 17:12:26 +03:00
frostfs.go [#9] logging: Make logger more functional 2023-02-28 14:18:53 +03:00
go.mod [#1] Build K6 extension with FrostFS dependencies 2022-12-22 11:13:47 +03:00
go.sum [#1] Build K6 extension with FrostFS dependencies 2022-12-22 11:13:47 +03:00

README.md

FrostFS logo

k6 extension to test and benchmark FrostFS related protocols.


License: GPL v3

xk6-frostfs

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/TrueCloudLab/xk6-frostfs
cd xk6-frostfs
  1. Build the binary:
xk6 build --with github.com/TrueCloudLab/xk6-frostfs=.
  1. Run k6:
./k6 run test-script.js

API

Native

Create native client with connect method. Arguments:

  • frostfs storage node endpoint
  • hex encoded private key (empty value produces random key)
  • dial timeout in seconds (0 for the default value)
  • stream timeout in seconds (0 for the default value)
import native from 'k6/x/frostfs/native';
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "", 0, 0)

Methods

  • putContainer(params). The params is a dictionary (e.g. {acl:'public-read-write',placement_policy:'REP 3',name:'container-name',name_global_scope:'false'}). Returns dictionary with success boolean flag, container_id string, and error string.
  • setBufferSize(size). Sets internal buffer size for data upload and download. Default is 64 KiB.
  • 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.
  • onsite(container_id, payload). Returns FrostFS object instance with prepared headers. Invoke put(headers) method on this object to upload it into FrostFS. It returns dictionary with success boolean flag, object_id string 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/frostfs/s3';
const s3_cli = s3.connect("http://s3.frostfs.devenv:8080")

You can also provide additional options:

import s3 from 'k6/x/frostfs/s3';
const s3_cli = s3.connect("http://s3.frostfs.devenv:8080", {'no_verify_ssl': 'true', 'timeout': '60s'})
  • no_verify_ss - Bool. If true - skip verifying the s3 certificate chain and host name (useful if s3 uses self-signed certificates)
  • timeout - Duration. Set timeout for requests (in http client). If omitted or zero - timeout is infinite.

Methods

  • createBucket(bucket, params). Returns dictionary with success boolean flag and error string. The params is a dictionary (e.g. {acl:'private',lock_enabled:'true',location_constraint:'ru'})
  • 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.

License