void PerfCountersCache::check_key(const std::string &key) {
[[maybe_unused]] std::string_view key_name = ceph::perf_counters::key_name(key);
// don't accept an empty key name
- assert(key_name != "");
+ ceph_assert(key_name != "");
// if there are no labels, key name is not valid
auto key_labels = ceph::perf_counters::key_labels(key);
- assert(key_labels.begin() != key_labels.end());
+ ceph_assert(key_labels.begin() != key_labels.end());
// don't accept keys where any labels in the key have an empty key name
for ([[maybe_unused]] auto key_label : key_labels) {
- assert(key_label.first != "");
+ ceph_assert(key_label.first != "");
}
}
auto [ref, key_existed] = cache.get_or_create(key);
if (!key_existed) {
ref->counters = create_counters(key, cct);
- assert(ref->counters);
+ ceph_assert(ref->counters);
ref->cct = cct;
}
return ref->counters;