Skip to content

Commit

Permalink
Merge pull request redpanda-data#17615 from redpanda-data/PESDLC-1063…
Browse files Browse the repository at this point in the history
…-htt-test-consume-miss-cache

PESDLC-1063 Refactor test_consume_miss_cache
  • Loading branch information
savex authored Apr 9, 2024
2 parents a5a7355 + 8927b79 commit 4c47fe9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 4 additions & 8 deletions tests/rptest/redpanda_cloud_tests/high_throughput_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,6 @@ def consumer_saw_msgs(consumer):
# The testcase occasionally fails on various parts:
# - toing on `_consume_from_offset(self.topic, 1, p_id, "newest", 30)`
# - failing to ensure all manifests are in the cloud in `stop_and_scrub_object_storage`
@ignore
@cluster(num_nodes=7, log_allow_list=RESTART_LOG_ALLOW_LIST)
def test_consume_miss_cache(self):
# create default topics
Expand Down Expand Up @@ -1498,14 +1497,11 @@ def stage_consume_miss_cache(self, producer: KgoVerifierProducer):
partition_size_check: list[MetricCheck] = []
partition_size_metric = "vectorized_storage_log_partition_size"

# https://github.com/redpanda-data/cloudv2/issues/10685#issuecomment-1893009486
raise NotImplementedError('partition_size_check not implemented')

for node in self.redpanda.nodes:
for pod in self.redpanda.pods:
partition_size_check.append(
MetricCheck(self.logger,
self.redpanda,
node,
pod,
partition_size_metric,
reduce=sum))

Expand Down Expand Up @@ -1598,11 +1594,11 @@ def check_partition_size(old_size, new_size):
"vectorized_storage_log_cached_read_bytes_total",
]

for node in self.redpanda.nodes:
for pod in self.redpanda.pods:
check_batch_cache_reads.append(
MetricCheck(self.logger,
self.redpanda,
node,
pod,
cache_metrics,
reduce=sum))

Expand Down
18 changes: 12 additions & 6 deletions tests/rptest/services/metrics_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ def _capture(self, check_metrics):
self.logger.info(f" Captured {k}={v}")

if len(samples) == 0:
metrics_endpoint = ("/metrics" if self._metrics_endpoint
== MetricsEndpoint.METRICS else
"/public_metrics")
url = f"http://{self.node.account.hostname}:9644{metrics_endpoint}"
import requests
dump = requests.get(url).text
# Announce
dump = "No metrics extracted"
# handle cloud cluster separately
if getattr(self.redpanda, "_cloud_cluster", None) is None:
metrics_endpoint = ("/metrics" if self._metrics_endpoint
== MetricsEndpoint.METRICS else
"/public_metrics")
url = f"http://{self.node.account.hostname}:9644{metrics_endpoint}"
import requests
dump = requests.get(url).text
else:
dump = self.redpanda._cloud_cluster.get_public_metrics()
self.logger.warn(f"Metrics dump: {dump}")
raise RuntimeError("Failed to capture metrics!")

Expand Down

0 comments on commit 4c47fe9

Please sign in to comment.