| 412 | } |
| 413 | |
| 414 | std::size_t RefillGuard::snapshotBytes() const noexcept { |
| 415 | std::size_t bytes = 0; |
| 416 | // Scalar: approximate — rows * (1 timestamp column + N value columns) * 8 bytes/cell. |
| 417 | for (const auto& [topic_id, topic] : scalar_snapshot_.topics) { |
| 418 | (void)topic_id; |
| 419 | for (const TopicChunk& chunk : topic.chunks) { |
| 420 | const std::size_t cells = static_cast<std::size_t>(chunk.stats.row_count) * (1 + chunk.columns.size()); |
| 421 | bytes += cells * sizeof(double); |
| 422 | } |
| 423 | } |
| 424 | // Object: exact — the store tracks per-series resident bytes. |
| 425 | for (const auto& [raw_id, series] : object_snapshot_.series) { |
| 426 | (void)raw_id; |
| 427 | bytes += series.memory_bytes; |
| 428 | } |
| 429 | return bytes; |
| 430 | } |
| 431 | |
| 432 | void SessionManager::replaceDataset( |
| 433 | DataEngine& staged_engine, ObjectStore& staged_store, DatasetId staged_id, DatasetId primary_id, |