From eaf5db66a83da176de491adaa3e9a5ddcb5617bc Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov Date: Mon, 22 Aug 2016 16:58:21 +0300 Subject: [PATCH] tracing::session_record: store "parameters" data in an std::map instead of in an unordered_map Avoid sorting (and creating a new one) container at a backend code when a sorted container is needed. The overhead for the backends where it's not needed is minimal since the size of the map is very small. Signed-off-by: Vlad Zolotarov --- tracing/tracing.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracing/tracing.hh b/tracing/tracing.hh index d4e8b0eb2e..407605211b 100644 --- a/tracing/tracing.hh +++ b/tracing/tracing.hh @@ -151,7 +151,10 @@ struct event_record { struct session_record { gms::inet_address client; - std::unordered_map parameters; + // Keep the container below sorted since some backends require that and it's + // very cheap to always do that because the amount of elements in a + // container is very small. + std::map parameters; sstring request; std::chrono::system_clock::time_point started_at; trace_type command = trace_type::NONE;