#include <rocksdb/version.h>
#include "common/errno.h"
+#include "common/perf_counters_key.h"
#include "crush/CrushWrapper.h"
#include "include/stringify.h"
f.open_object_section(key.c_str());
for (auto ctr_inst_iter : state->perf_counters.instances) {
const auto &counter_name = ctr_inst_iter.first;
- f.open_object_section(counter_name.c_str());
- auto type = state->perf_counters.types[counter_name];
+
+ // Ignore labeled counters. The perf schema format below can not
+ // accomodate counters with labels. A new representation format is
+ // requried to do support this.
+ auto labels = ceph::perf_counters::key_labels(counter_name);
+ if (labels.begin() != labels.end()) {
+ continue;
+ }
+
+ f.open_object_section(counter_name.c_str());
+ auto type = state->perf_counters.types[counter_name];
f.dump_string("description", type.description);
if (!type.nick.empty()) {
f.dump_string("nick", type.nick);
const std::string &svc_id,
const std::string &path);
PyObject *get_latest_unlabeled_counter_python(
- const std::string &svc_type,
- const std::string &svc_id,
- const std::string &path);
+ const std::string &svc_type,
+ const std::string &svc_id,
+ const std::string &path);
PyObject *get_unlabeled_perf_schema_python(
- const std::string &svc_type,
- const std::string &svc_id);
+ const std::string &svc_type,
+ const std::string &svc_id);
PyObject *get_rocksdb_version();
PyObject *get_context();
PyObject *get_osdmap();
/// @note @c fct is not allowed to acquire locks when holding GIL
PyObject *with_unlabled_perf_counters(
std::function<void(
- PerfCounterInstance& counter_instance,
- PerfCounterType& counter_type,
- PyFormatter& f)> fct,
+ PerfCounterInstance &counter_instance,
+ PerfCounterType &counter_type,
+ PyFormatter &f)> fct,
const std::string &svc_name,
const std::string &svc_id,
const std::string &path) const;
"Get a performance counter"},
{"_ceph_get_latest_unlabeled_counter", (PyCFunction)get_latest_unlabeled_counter, METH_VARARGS,
- "Get the latest performance counter"},
+ "Fetch (or get) the latest (or updated) value of an unlabeled counter"},
{"_ceph_get_unlabeled_perf_schema", (PyCFunction)get_unlabeled_perf_schema, METH_VARARGS,
"Get the unlabeled performance counter schema"},
{
// Helper for checking whether a counter should be included
auto include_counter = [this](
- const PerfCounters::perf_counter_data_any_d &ctr,
- const PerfCounters &perf_counters)
- {
- // FIXME: We don't send labeled perf counters to the mgr currently.
- auto labels = ceph::perf_counters::key_labels(perf_counters.get_name());
- if (labels.begin() != labels.end()) {
- return false;
- }
-
+ const PerfCounters::perf_counter_data_any_d &ctr,
+ const PerfCounters &perf_counters) {
return perf_counters.get_adjusted_priority(ctr.prio) >= (int)stats_threshold;
};