]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/admin: dump DERIVE metrics as signed integer 42203/head
authorKefu Chai <kchai@redhat.com>
Wed, 7 Jul 2021 02:29:59 +0000 (10:29 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 7 Jul 2021 02:31:14 +0000 (10:31 +0800)
per include/seastar/core/metrics.hh,

// The value binding data types
enum class data_type : uint8_t {
    COUNTER, // unsigned int 64
    GAUGE, // double
    DERIVE, // signed int 64
    ABSOLUTE, // unsigned int 64
    HISTOGRAM,
};

the DERIVE values are signed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/admin/osd_admin.cc

index a69cd84b4adeda64e3722f9c918b339f9c707434..e1c8c5b4d8ab4a661154eaa96f87b6a405244ed1 100644 (file)
@@ -238,10 +238,11 @@ private:
       f->dump_float(full_name, v.d());
       break;
     case data_type::COUNTER:
-      [[fallthrough]];
-    case data_type::DERIVE:
       f->dump_unsigned(full_name, v.ui());
       break;
+    case data_type::DERIVE:
+      f->dump_int(full_name, v.i());
+      break;
     case data_type::HISTOGRAM: {
       f->open_object_section(full_name);
       auto&& h = v.get_histogram();