scylladb / cql-stress

8 stars 4 forks source link

c-s: Implement query/operation sampler #87

Closed muzarski closed 2 weeks ago

muzarski commented 3 weeks ago

Fix: https://github.com/scylladb/cql-stress/issues/80

This PR extends a CLI for user command by ops() and clustering= parameters.

The semantics of parameters:

The struct that will make use of these parameters is OperationSampler. At first, I wanted to implement it in a way so it can be used for both user and mixed commands. The reason for this is that mixed command supports two analogous parameters: ratio and clustering. However, due to the Rust language limitations it's really hard (or even impossible) to implement the operation sampler this way. CassandraStressOperation trait declares async methods, thus it is not object-safe, and so we cannot create trait objects based on this trait (Box<dyn CassandraStressOperation>).

I decided to leave the code for mixed command as is for now.

muzarski commented 2 weeks ago

v2: addressed review comments