riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

allow using nodes option for stress #608

Closed XN137 closed 7 years ago

XN137 commented 7 years ago

it was not possible to give a custom nodes parameter to stress, because all live nodes are added all the time.

before:

→ ccm status test1                                           
Cluster: 'test1'
----------------
node1: UP
node3: UP
node2: UP

# chris in ~/code/ccm on git:master ✖︎ [9:21:54]
→ ccm stress write n=1000 -node whitelist 127.0.0.1,127.0.0.2
-node is defined multiple times. Each option/command can be specified at most once.
Usage:      cassandra-stress <command> [options]
Help usage: cassandra-stress help <command>
...

after this PR it is possible:

# chris in ~/code/ccm on git:stress-nodes-options ✖︎ [9:19:20]
→ ccm status test1                                           
Cluster: 'test1'
----------------
node1: UP
node3: UP
node2: UP

# chris in ~/code/ccm on git:stress-nodes-options ✖︎ [9:19:40]
→ ccm stress write n=1000 -node whitelist 127.0.0.1,127.0.0.2
******************** Stress Settings ********************
...
Node:
  Nodes: [127.0.0.1, 127.0.0.2]
...
Total operation time      : 00:00:00

END

# chris in ~/code/ccm on git:stress-nodes-options ✖︎ [9:19:54]
→ ccm stress write n=1000                                    
******************** Stress Settings ********************
...
Node:
  Nodes: [127.0.0.1, 127.0.0.3, 127.0.0.2]
...
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
total,           285,     285,     285,     285,    12.9,     9.7,    33.7,    47.3,    57.6,    57.6,    1.0,  0.00000,      0,      0,       0,       0,       0,       0
total,          1000,    3401,    3401,    3401,    35.9,    28.9,    94.0,   125.0,   138.5,   143.3,    1.2,  0.66815,      0,      0,       0,       0,       0,       0
...
Total operation time      : 00:00:01

END

additionally before the stress cmd always exited with return code 0:

→ ccm stress write foo=1000; echo $?
Invalid parameter foo=1000
Usage:      cassandra-stress <command> [options]
Help usage: cassandra-stress help <command>
...
-tokenrange           : Token range settings
0

now it will correctly indicate an error:

→ ccm stress write foo=1000; echo $? 
Invalid parameter foo=1000
Usage:      cassandra-stress <command> [options]
Help usage: cassandra-stress help <command>
...
-tokenrange           : Token range settings
1

# chris in ~/code/ccm on git:stress-nodes-options ✖︎ [9:35:04]
→ ccm stress write n=1000; echo $?
******************** Stress Settings ********************
...
Total operation time      : 00:00:00

END
0