From 9e4157b39f922bdb9b14d9bf4f2563269883c4b0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 21 Jul 2021 01:09:40 +0800 Subject: [PATCH] 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 --- src/crimson/os/seastore/seastore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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} -- 2.47.3