tjeyy / dyod22-memory-tracking

Hyrise is a research in-memory database.
https://hpi.de/plattner/projects/hyrise.html
MIT License
1 stars 0 forks source link

improve timestamp creation #23

Closed twollnik closed 2 years ago

twollnik commented 2 years ago

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();

twollnik commented 2 years ago

implemented in: https://github.com/tjjordan/dyod22-memory-tracking/commit/bcacf4b258f2feeb6637ae1653181971d1104bd3