--- /dev/null
+roles:
+- - mon.a
+ - mon.b
+ - mon.c
+ - mgr.x
+ - osd.0
+ - osd.1
+ - osd.2
+ - client.0
+openstack:
+ - volumes: # attached to each instance
+ count: 3
+ size: 10 # GB
+tasks:
+- install:
+- ceph:
+ pre-mgr-commands:
+ - sudo ceph config set mgr mgr_pool false --force
+ log-ignorelist:
+ - but it is still running
+ - overall HEALTH_
+ conf:
+ osd:
+ osd min pg log entries: 5
+ crimson cpu num: 2
+ global:
+- workunit:
+ clients:
+ client.0:
+ - cephtool/test_crimson_dump_metrics.sh
--- /dev/null
+#!/bin/bash
+
+. $(dirname $0)/../../standalone/ceph-helpers.sh
+
+set -x
+
+function test_dump_metrics() {
+ # Ensure can get dump_metrics full
+ ceph tell osd.0 dump_metrics 2>/dev/null > /tmp/dump_metrics_full.json || true
+
+ # Ensure can get dump_metrics reactor_utilization: can be done with each metric name individually
+ ceph tell osd.0 dump_metrics reactor_utilization 2>/dev/null > /tmp/dump_metrics_reactor.json || true
+
+ # The number of occurrences must match (must be greater than zero)
+ full_count=$(grep -c reactor_utilization /tmp/dump_metrics_full.json)
+ reactor_count=$(grep -c reactor_utilization /tmp/dump_metrics_reactor.json)
+
+ [ $full_count -gt 0 ] || return 1
+ [ $reactor_count -gt 0 ] || return 1
+ [ $full_count -eq $reactor_count ] || return 1
+
+ # Remove auxiliary files
+ rm -f /tmp/dump_metrics_full.json /tmp/dump_metrics_reactor.json
+ return 0 # success
+}
+
+# A more complete test: traverse the "metrics" section and ensure each metric contains the expected attributes
+
+test_dump_metrics || { echo "test_dump_metrics failed"; exit 1; }
+
+echo "OK"
+
seastar::scollectd::get_value_map(),
f,
[prefix](const auto &full_name) {
- return prefix.empty() || full_name.compare(0, prefix.size(), prefix) != 0;
+ return prefix.empty() || full_name.compare(0, prefix.size(), prefix) == 0;
});
});
fref->close_section();