mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 12:36:56 +00:00
tracing::session_record: make start_at to be a time_point
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
@@ -223,7 +223,8 @@ mutation trace_keyspace_helper::make_session_mutation(const one_session_records&
|
||||
cells.apply(*_client_column, atomic_cell::make_live(timestamp, inet_addr_type->decompose(record.client.addr()), ttl));
|
||||
cells.apply(*_coordinator_column, atomic_cell::make_live(timestamp, inet_addr_type->decompose(utils::fb_utilities::get_broadcast_address().addr()), ttl));
|
||||
cells.apply(*_request_column, atomic_cell::make_live(timestamp, utf8_type->decompose(record.request), ttl));
|
||||
cells.apply(*_started_at_column, atomic_cell::make_live(timestamp, timestamp_type->decompose(record.started_at), ttl));
|
||||
auto millis_since_epoch = std::chrono::duration_cast<std::chrono::milliseconds>(record.started_at.time_since_epoch()).count();
|
||||
cells.apply(*_started_at_column, atomic_cell::make_live(timestamp, timestamp_type->decompose(millis_since_epoch), ttl));
|
||||
cells.apply(*_command_column, atomic_cell::make_live(timestamp, utf8_type->decompose(type_to_string(record.command)), ttl));
|
||||
cells.apply(*_duration_column, atomic_cell::make_live(timestamp, int32_type->decompose((int32_t)record.elapsed), ttl));
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
begin();
|
||||
_records->session_rec.client = client;
|
||||
_records->session_rec.request = std::move(request);
|
||||
_records->session_rec.started_at = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
_records->session_rec.started_at = std::chrono::system_clock::now();
|
||||
}
|
||||
|
||||
template <typename Func>
|
||||
|
||||
@@ -151,7 +151,7 @@ struct session_record {
|
||||
gms::inet_address client;
|
||||
std::unordered_map<sstring, sstring> parameters;
|
||||
sstring request;
|
||||
long started_at = 0;
|
||||
std::chrono::system_clock::time_point started_at;
|
||||
trace_type command = trace_type::NONE;
|
||||
int elapsed = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user