scylladb / cql-stress

8 stars 4 forks source link

User command: parsing logic + schema creation #74

Closed muzarski closed 1 month ago

muzarski commented 3 months ago

ref: https://cassandra.apache.org/doc/stable/cassandra/tools/cassandra_stress.html#user-mode

Motivation

User command is the most complex c-s command. It is very flexible and allows user to define his own schema, as well as stress queries. We obviously want to support this command in cql-stress.

User profiles

ref: https://cassandra.apache.org/doc/stable/cassandra/tools/cassandra_stress.html#profile

User can define the benchmark via profile yaml file. In this PR we introduce support for most commonly used profile parameters, which are:

Changes

Tests

I think I could add some tests with exemplary yaml files. I'm not sure if it's a good idea since this would pollute our repo a bit (?). WDYT?

wprzytula commented 2 months ago

I think I could add some tests with exemplary yaml files. I'm not sure if it's a good idea since this would pollute our repo a bit (?). WDYT?

Definitely, do that! Those will serve both as test cases and for quick reference on what kind of user config is supported.

muzarski commented 2 months ago

v2:

wprzytula commented 2 months ago

Is the list of features documented somewhere? If we support something (in this case: user profiles) only conditionally, it should definitely be said that you can turn it using name-of-the-feature.

muzarski commented 1 month ago

v2.1: moved queries.is_empty() check, so it is detected during yaml file parsing.

muzarski commented 1 month ago

I think I could add some tests with exemplary yaml files. I'm not sure if it's a good idea since this would pollute our repo a bit (?). WDYT?

Definitely, do that! Those will serve both as test cases and for quick reference on what kind of user config is supported.

v3: added test cases for contents of yaml files

muzarski commented 1 month ago

v3.1: adjusted the logic so unknown yaml parameters are denied and treated as error.

muzarski commented 1 month ago

Is the list of features documented somewhere? If we support something (in this case: user profiles) only conditionally, it should definitely be said that you can turn it using name-of-the-feature.

The problem is that README for c-s frontend is just empty. I'll open a PR that updates the README (and includes info about user profiles and set of supported features) which will base on this PR. WDYT?