]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/perf_counters: require nicks be <= 4 chars
authorSage Weil <sage@redhat.com>
Tue, 28 Mar 2017 02:41:39 +0000 (22:41 -0400)
committerDan Mick <dan.mick@redhat.com>
Tue, 25 Apr 2017 23:19:01 +0000 (16:19 -0700)
This keeps the column sizes at 5 chars for 'ceph daemonperf'.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/perf_counters.cc

index c869880a1e2426539344189339b5d449a860a370..0e8355ccde2b9a9cd4fadcb3673ac9341ac10c03 100644 (file)
@@ -504,6 +504,10 @@ void PerfCountersBuilder::add_impl(int idx, const char *name,
   assert(data.type == PERFCOUNTER_NONE);
   data.name = name;
   data.description = description;
+  // nick must be <= 4 chars
+  if (nick) {
+    assert(strlen(nick) <= 4);
+  }
   data.nick = nick;
   data.type = (enum perfcounter_type_d)ty;
   data.histogram = std::move(histogram);