scylladb / scylla-jmx

Scylla JMX proxy
GNU Affero General Public License v3.0
28 stars 52 forks source link

storage_service: Add a generic toppartitions endpoint #157

Closed StarostaGit closed 3 years ago

StarostaGit commented 3 years ago

As part of making the toppartitions API more generic (i.e. being able to consider multiple tables and keyspaces specified by the user) this commit adds a JMX endpoint to call the generic Scylla REST API introduced in #7864. It has been put inside storage_service as being now able to query more than one column family makes it no longer suitable for the 'column_family' group.

Fixes #4520

avikivity commented 3 years ago

@amnonh I'm relying on your review here.

StarostaGit commented 3 years ago

rebased to resolve conflicts @amnonh ping

amnonh commented 3 years ago

LGTM - the only concern I had was about spliting the string and join it back again, but I'm fine with this approach

StarostaGit commented 3 years ago

this should be merged after https://github.com/scylladb/scylla/pull/7864 is merged

StarostaGit commented 3 years ago

this should be merged after scylladb/scylla#7864 is merged

It's merged now, so this can be committed as well

tzach commented 3 years ago

@StarostaGit can you please provide a few example for using nodetool top partitions with the new options?

StarostaGit commented 3 years ago

@StarostaGit can you please provide a few example for using nodetool top partitions with the new options?

@tzach should I put it somewhere or just list it here? But in general it works as follows: nodetool toppartitions -> considers all partitions in all tables in all keyspaces with default duration nodetool toppartitions -d 1000 -> same as above, but the duration is specified to be 1000ms nodetool toppartitions --cf-filters ks:t,system:status -> toppartitions query only for partitions from table t in keyspace ks and table status in keyspace system nodetool toppartitions --ks-filters ks,system -> toppartitions query considering partitions from all tables inside ks and system keyspaces nodetool toppartitions --ks-filters ks --cf-filters system:local -> toppartitions query considering partitions from all tables inside the keyspace ks and from the table local inside keyspace system