From: Kefu Chai Date: Tue, 20 Jul 2021 17:09:40 +0000 (+0800) Subject: crimson/os/seastore: trade a map with a plain array X-Git-Tag: v17.1.0~1348^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42427%2Fhead;p=ceph.git crimson/os/seastore: trade a map with a plain array simpler this way, as we don't need a std::map<> at all. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index 4b8fcb7b1c2d..462b04440999 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -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 labels_by_op_type = { + std::pair 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}