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 <vladz@cloudius-systems.com>
This commit is contained in:
Vlad Zolotarov
2016-08-22 16:58:21 +03:00
parent 80f7449095
commit eaf5db66a8

View File

@@ -151,7 +151,10 @@ struct event_record {
struct session_record {
gms::inet_address client;
std::unordered_map<sstring, sstring> 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<sstring, sstring> parameters;
sstring request;
std::chrono::system_clock::time_point started_at;
trace_type command = trace_type::NONE;