I believe it would be better to store the raw timestamps in the TrackingMemoryResource and only cast them to long in the MetaTemporaryMemoryUsageTable. This would decouple the data collection from the display logic (currently we only store the timestamp as a long because this is what is needed in the meta table, not because it makes the most sense for the memory resource itself).
An added benefit is consistency with other parts of the code base. The MetaLogTable solves the same problem by storing std::chrono::system_clock::time_points and only casting them to longs (at nanosecond granularity) in the meta table: const auto timestamp_ns = std::chrono::nanoseconds{entry.timestamp.time_since_epoch()}.count();
I believe it would be better to store the raw timestamps in the
TrackingMemoryResource
and only cast them to long in theMetaTemporaryMemoryUsageTable
. This would decouple the data collection from the display logic (currently we only store the timestamp as a long because this is what is needed in the meta table, not because it makes the most sense for the memory resource itself).An added benefit is consistency with other parts of the code base. The
MetaLogTable
solves the same problem by storingstd::chrono::system_clock::time_point
s and only casting them to longs (at nanosecond granularity) in the meta table:const auto timestamp_ns = std::chrono::nanoseconds{entry.timestamp.time_since_epoch()}.count();