]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: trade a map with a plain array 42427/head
authorKefu Chai <kchai@redhat.com>
Tue, 20 Jul 2021 17:09:40 +0000 (01:09 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 20 Jul 2021 17:09:41 +0000 (01:09 +0800)
simpler this way, as we don't need a std::map<> at all.

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

index 4b8fcb7b1c2d040c23c06310777656612ebc2863..462b04440999f7a885e57cc2206f43fefd5ab2a1 100644 (file)
@@ -51,7 +51,7 @@ void SeaStore::register_metrics()
   namespace sm = seastar::metrics;
   using op_type_t = SeaStore::op_type_t;
   auto lat_label = sm::label("latency");
-  std::map<op_type_t, sm::label_instance> labels_by_op_type = {
+  std::pair<op_type_t, sm::label_instance> labels_by_op_type[] = {
     {op_type_t::TRANSACTION,     lat_label("TRANSACTION")},
     {op_type_t::READ,            lat_label("READ")},
     {op_type_t::WRITE,           lat_label("WRITE")},
@@ -70,7 +70,7 @@ void SeaStore::register_metrics()
       {
         sm::make_histogram(
           "op_lat", [this, op_type] {
-          return get_latency(op_type);
+            return get_latency(op_type);
           },
           sm::description(desc),
           {label}