MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / snapshotBytes

Method snapshotBytes

pj_runtime/src/SessionManager.cpp:414–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414std::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
432void SessionManager::replaceDataset(
433 DataEngine& staged_engine, ObjectStore& staged_store, DatasetId staged_id, DatasetId primary_id,

Callers 1

TESTFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36