Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tree/ntupleutil/inc/ROOT/RNTupleInspector.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,16 @@ public:
/////////////////////////////////////////////////////////////////////////////
/// \brief Print a string that represents the tree of the (sub)fields and columns of an RNTuple in a format which a
/// performance profile visualizer can render
void PrintSchemaProfile(ESchemaProfileFormat format, std::ostream &output = std::cout) const;
void PrintSchemaProfile(std::ostream &output = std::cout,
ESchemaProfileFormat format = ESchemaProfileFormat::kSpeedscopeJSON) const;

////////////////////////////////////////////////////////////////////////////
/// \brief Print a string that represents the on-disk storage of the cluster groups, clusters, column ranges, pages,
/// header, footer and page lists on an RNTuple in a format which a performance profile visualizer can render
///
/// \warning ntuple must have a file-based backend
void PrintDiskProfile(ESchemaProfileFormat format, std::ostream &output = std::cout) const;
void PrintDiskProfile(std::ostream &output = std::cout,
ESchemaProfileFormat format = ESchemaProfileFormat::kSpeedscopeJSON) const;
};
} // namespace Experimental
} // namespace ROOT
Expand Down
11 changes: 6 additions & 5 deletions tree/ntupleutil/src/RNTupleInspector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ static void PrintSpeedscopeFrames(const std::vector<SpeedscopeFrame> &frames, st
}
} // namespace

void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile([[maybe_unused]] ESchemaProfileFormat format,
std::ostream &output) const
void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile(std::ostream &output,
[[maybe_unused]] ESchemaProfileFormat format) const
{
// There is only one format at the moment
assert(format == ESchemaProfileFormat::kSpeedscopeJSON);
Expand Down Expand Up @@ -693,8 +693,8 @@ void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile([[maybe_unused]] E
PrintSpeedscopeFrames(frames, output);
}

void ROOT::Experimental::RNTupleInspector::PrintDiskProfile([[maybe_unused]] ESchemaProfileFormat format,
std::ostream &output) const
void ROOT::Experimental::RNTupleInspector::PrintDiskProfile(std::ostream &output,
[[maybe_unused]] ESchemaProfileFormat format) const
{
// There is only one format at the moment
assert(format == ESchemaProfileFormat::kSpeedscopeJSON);
Expand Down Expand Up @@ -734,7 +734,8 @@ void ROOT::Experimental::RNTupleInspector::PrintDiskProfile([[maybe_unused]] ESc

RDiskPageLeaf pageLeaf;
pageLeaf.fPosition = locator.GetPosition<std::uint64_t>();
pageLeaf.fSize = locator.GetNBytesOnStorage();
pageLeaf.fSize = locator.GetNBytesOnStorage() +
pageInfo.HasChecksum() * ROOT::Internal::RPageStorage::kNBytesPageChecksum;
pageLeaf.fName = "[page @" + std::to_string(pageLeaf.fPosition) + "]";
pageLeaf.fAncestors = {groupId, clusterId, columnId};
pageLeaves.push_back(pageLeaf);
Expand Down
24 changes: 12 additions & 12 deletions tree/ntupleutil/test/ntuple_inspector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ TEST(RNTupleInspector, SchemaProfile)
}
auto inspector = RNTupleInspector::Create("ntuple", fileGuard.GetPath());
std::ostringstream schemaProfileStream;
inspector->PrintSchemaProfile(ROOT::Experimental::ESchemaProfileFormat::kSpeedscopeJSON, schemaProfileStream);
inspector->PrintSchemaProfile(schemaProfileStream);
const std::string schemaProfile = schemaProfileStream.str();
const std::string expected = R"foo({
"$schema":"https://www.speedscope.app/file-format-schema.json",
Expand Down Expand Up @@ -1129,7 +1129,7 @@ TEST(RNTupleInspector, DiskProfile)

auto inspector = RNTupleInspector::Create("shuffled_ntuple", fileGuard.GetPath());
std::ostringstream diskProfileStream;
inspector->PrintDiskProfile(ROOT::Experimental::ESchemaProfileFormat::kSpeedscopeJSON, diskProfileStream);
inspector->PrintDiskProfile(diskProfileStream);
const std::string diskProfile = diskProfileStream.str();
const std::string expected = R"foo({
"$schema":"https://www.speedscope.app/file-format-schema.json",
Expand Down Expand Up @@ -1178,14 +1178,14 @@ TEST(RNTupleInspector, DiskProfile)
{"type":"O","frame":2,"at":882},
{"type":"O","frame":3,"at":882},
{"type":"O","frame":4,"at":882},
{"type":"C","frame":4,"at":1082},
{"type":"C","frame":4,"at":1090},
{"type":"O","frame":5,"at":1132},
{"type":"C","frame":5,"at":1232},
{"type":"C","frame":3,"at":1232},
{"type":"O","frame":6,"at":1274},
{"type":"O","frame":7,"at":1274},
{"type":"C","frame":7,"at":1674},
{"type":"C","frame":6,"at":1674},
{"type":"C","frame":7,"at":1682},
{"type":"C","frame":6,"at":1682},
{"type":"O","frame":8,"at":1724},
{"type":"O","frame":9,"at":1724},
{"type":"C","frame":9,"at":1824},
Expand All @@ -1194,9 +1194,9 @@ TEST(RNTupleInspector, DiskProfile)
{"type":"O","frame":10,"at":1866},
{"type":"O","frame":11,"at":1866},
{"type":"O","frame":12,"at":1866},
{"type":"C","frame":12,"at":2266},
{"type":"C","frame":11,"at":2266},
{"type":"C","frame":10,"at":2266},
{"type":"C","frame":12,"at":2274},
{"type":"C","frame":11,"at":2274},
{"type":"C","frame":10,"at":2274},
{"type":"O","frame":13,"at":2316},
{"type":"O","frame":14,"at":2316},
{"type":"O","frame":15,"at":2316},
Expand All @@ -1208,10 +1208,10 @@ TEST(RNTupleInspector, DiskProfile)
{"type":"O","frame":17,"at":2758},
{"type":"O","frame":18,"at":2758},
{"type":"O","frame":19,"at":2758},
{"type":"C","frame":19,"at":3158},
{"type":"C","frame":18,"at":3158},
{"type":"C","frame":17,"at":3158},
{"type":"C","frame":16,"at":3158},
{"type":"C","frame":19,"at":3166},
{"type":"C","frame":18,"at":3166},
{"type":"C","frame":17,"at":3166},
{"type":"C","frame":16,"at":3166},
{"type":"O","frame":20,"at":3208},
{"type":"O","frame":21,"at":3208},
{"type":"O","frame":22,"at":3208},
Expand Down
Loading