23#include <unordered_map>
29 std::uint64_t fFirstEntry = 0;
30 std::uint32_t fNPages = 0;
31 std::uint32_t fNEntries = 0;
32 std::uint32_t fNBytesOnStorage = 0;
33 std::uint32_t fNBytesInMemory = 0;
44 std::uint64_t fNElements = 0;
45 std::uint64_t fNPages = 0;
46 std::uint64_t fNBytesOnStorage = 0;
47 std::uint32_t fElementSize = 0;
48 std::uint32_t fColumnIndex = 0;
49 std::uint16_t fRepresentationIndex = 0;
51 std::string fFieldName;
52 std::string fFieldDescription;
56 if (fFieldName ==
other.fFieldName) {
57 if (fRepresentationIndex ==
other.fRepresentationIndex)
58 return fColumnIndex <
other.fColumnIndex;
59 return fRepresentationIndex <
other.fRepresentationIndex;
61 return fFieldName <
other.fFieldName;
83 std::vector<ColumnInfo>
columns;
85 std::unordered_map<ROOT::DescriptorId_t, unsigned int>
cluster2Idx;
89 info.fFirstEntry =
cluster.second.GetFirstEntryIndex();
102 if (column.second.IsAliasColumn())
110 info.fPhysicalColumnId = column.second.GetPhysicalId();
111 info.fLogicalColumnId = column.second.GetLogicalId();
112 info.fFieldId = column.second.GetFieldId();
113 info.fColumnIndex = column.second.GetIndex();
115 info.fType = column.second.GetType();
116 info.fRepresentationIndex = column.second.GetRepresentationIndex();
127 const auto &
pageRange =
cluster.second.GetPageRange(column.second.GetPhysicalId());
132 clusters[idx].fNBytesOnStorage +=
page.GetLocator().GetNBytesOnStorage();
135 info.fNBytesOnStorage +=
page.GetLocator().GetNBytesOnStorage();
144 output <<
"============================================================\n";
147 output <<
"------------------------------------------------------------\n";
155 output <<
" Compression rate: " << std::fixed << std::setprecision(2)
161 output <<
" Meta-data / data: " << std::fixed << std::setprecision(3)
163 output <<
"------------------------------------------------------------\n";
164 output <<
"CLUSTER DETAILS\n";
165 output <<
"------------------------------------------------------------" << std::endl;
168 for (
unsigned int i = 0; i <
clusters.size(); ++i) {
169 output <<
" # " << std::setw(5) << i <<
" Entry range: [" <<
clusters[i].fFirstEntry <<
".."
172 output <<
" " <<
" Size on storage: " <<
clusters[i].fNBytesOnStorage <<
" B\n";
173 output <<
" " <<
" Compression: " << std::fixed << std::setprecision(2)
174 << float(
clusters[i].fNBytesInMemory) / float(
float(
clusters[i].fNBytesOnStorage)) << std::endl;
177 output <<
"------------------------------------------------------------\n";
178 output <<
"COLUMN DETAILS\n";
179 output <<
"------------------------------------------------------------\n";
181 col.fFieldName = GetFieldName(col.fFieldId, *
this).substr(1);
182 col.fFieldDescription = GetFieldDescription(col.fFieldId, *
this);
185 for (
const auto &col :
columns) {
186 auto avgPageSize = (col.fNPages == 0) ? 0 : (col.fNBytesOnStorage / col.fNPages);
188 std::string
nameAndType = std::string(
" ") + col.fFieldName +
" [#" + std::to_string(col.fColumnIndex);
189 if (col.fRepresentationIndex > 0)
190 nameAndType +=
" / R." + std::to_string(col.fRepresentationIndex);
192 std::string
id = std::string(
"{id:") + std::to_string(col.fLogicalColumnId) +
"}";
193 if (col.fLogicalColumnId != col.fPhysicalColumnId)
194 id +=
" --alias--> " + std::to_string(col.fPhysicalColumnId);
196 if (!col.fFieldDescription.empty())
197 output <<
" Description: " << col.fFieldDescription <<
"\n";
198 output <<
" # Elements: " << col.fNElements <<
"\n";
199 output <<
" # Pages: " << col.fNPages <<
"\n";
202 output <<
" Size on storage: " << col.fNBytesOnStorage <<
" B\n";
203 output <<
" Compression: " << std::fixed << std::setprecision(2)
204 << float(col.fElementSize * col.fNElements) / float(col.fNBytesOnStorage) <<
"\n";
205 output <<
"............................................................" << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t operator<(const TDatime &d1, const TDatime &d2)
Bool_t operator==(const TDatime &d1, const TDatime &d2)
The available trivial, native content types of a column.
The on-storage meta-data of an ntuple.
std::size_t GetNLogicalColumns() const
const std::string & GetName() const
std::uint64_t GetOnDiskHeaderSize() const
std::size_t GetNClusters() const
std::size_t GetNFields() const
std::unordered_map< ROOT::DescriptorId_t, RColumnDescriptor > fColumnDescriptors
std::uint64_t GetOnDiskFooterSize() const
ROOT::NTupleSize_t GetNEntries() const
We know the number of entries from adding the cluster summaries.
std::unordered_map< ROOT::DescriptorId_t, RClusterDescriptor > fClusterDescriptors
May contain only a subset of all the available clusters, e.g.
std::size_t GetNPhysicalColumns() const
void PrintInfo(std::ostream &output) const
static const char * GetColumnTypeName(ROOT::ENTupleColumnType type)
static std::unique_ptr< RColumnElementBase > Generate(ROOT::ENTupleColumnType type)
If CppT == void, use the default C++ type for the given column type.
const_iterator begin() const
const_iterator end() const
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr DescriptorId_t kInvalidDescriptorId