nodetool: Implement [gs]etcompationthroughput commands

They exist in the original documentation, but are not yet implemented.
Now it's possible to do it.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2024-12-10 13:49:50 +03:00
parent eb29d6f4b0
commit 67089fd5a1
5 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#
# Copyright 2024-present ScyllaDB
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from test.nodetool.rest_api_mock import expected_request
import pytest
def test_get_compaction_throughput(nodetool, scylla_only):
res = nodetool("getcompactionthroughput", expected_requests = [
expected_request("GET", "/storage_service/compaction_throughput", response=0)
])
assert res.stdout == '0\n'
def test_set_compaction_throughput(nodetool, scylla_only):
nodetool("setcompactionthroughput", "100", expected_requests = [
expected_request("POST", "/storage_service/compaction_throughput", params={"value": "100"})
])