-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from nspcc-dev/feat/search-load
Feat/search load
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { check } from 'k6'; | ||
import native from 'k6/x/neofs/native'; | ||
|
||
const dial_timeout = 5 | ||
const stream_timeout = 15 | ||
const predefined_private_key = '' // usually no need for search requests in load tests | ||
const grpc_client = native.connect(__ENV.GRPC_ENDPOINT, predefined_private_key, dial_timeout, stream_timeout); | ||
const container = __ENV.cid | ||
|
||
export const options = { | ||
scenarios: { | ||
system_write: { | ||
executor: 'shared-iterations', | ||
vus: __ENV.vu, | ||
iterations: __ENV.i, | ||
exec: 'search', | ||
maxDuration: (24*365*100).toString()+"h", // default is 10m and this load is designed to be controlled by iterations only | ||
gracefulStop: '30s', | ||
}, | ||
}, | ||
}; | ||
|
||
export function search() { | ||
let res = grpc_client.search(container, [{ | ||
key: "test", | ||
operation: "STRING_EQUAL", | ||
value: "test" | ||
}]) | ||
check(res, { | ||
'search': (r) => { | ||
return r > 0; | ||
} | ||
} | ||
) | ||
} |