@@ -67,23 +67,27 @@ const std::string BLOCK_INDICES_DB = "block indices";
6767
6868struct TreeDBStats {
6969 uint64_t mapSize;
70+ uint64_t physicalFileSize;
7071 DBStats blocksDBStats;
7172 DBStats nodesDBStats;
7273 DBStats leafPreimagesDBStats;
7374 DBStats leafIndicesDBStats;
7475 DBStats blockIndicesDBStats;
7576
7677 TreeDBStats () = default ;
77- TreeDBStats (uint64_t mapSize)
78+ TreeDBStats (uint64_t mapSize, uint64_t physicalFileSize )
7879 : mapSize(mapSize)
80+ , physicalFileSize(physicalFileSize)
7981 {}
8082 TreeDBStats (uint64_t mapSize,
83+ uint64_t physicalFileSize,
8184 const DBStats& blockStats,
8285 const DBStats& nodesStats,
8386 const DBStats& leafPreimagesDBStats,
8487 const DBStats& leafIndicesStats,
8588 const DBStats& blockIndicesStats)
8689 : mapSize(mapSize)
90+ , physicalFileSize(physicalFileSize)
8791 , blocksDBStats(blockStats)
8892 , nodesDBStats(nodesStats)
8993 , leafPreimagesDBStats(leafPreimagesDBStats)
@@ -95,11 +99,18 @@ struct TreeDBStats {
9599
96100 ~TreeDBStats () = default ;
97101
98- MSGPACK_FIELDS (mapSize, blocksDBStats, nodesDBStats, leafPreimagesDBStats, leafIndicesDBStats, blockIndicesDBStats)
102+ MSGPACK_FIELDS (mapSize,
103+ physicalFileSize,
104+ blocksDBStats,
105+ nodesDBStats,
106+ leafPreimagesDBStats,
107+ leafIndicesDBStats,
108+ blockIndicesDBStats)
99109
100110 bool operator ==(const TreeDBStats& other) const
101111 {
102- return mapSize == other.mapSize && blocksDBStats == other.blocksDBStats && nodesDBStats == other.nodesDBStats &&
112+ return mapSize == other.mapSize && physicalFileSize == other.physicalFileSize &&
113+ blocksDBStats == other.blocksDBStats && nodesDBStats == other.nodesDBStats &&
103114 leafPreimagesDBStats == other.leafPreimagesDBStats && leafIndicesDBStats == other.leafIndicesDBStats &&
104115 blockIndicesDBStats == other.blockIndicesDBStats ;
105116 }
@@ -108,6 +119,7 @@ struct TreeDBStats {
108119 {
109120 if (this != &other) {
110121 mapSize = other.mapSize ;
122+ physicalFileSize = other.physicalFileSize ;
111123 blocksDBStats = std::move (other.blocksDBStats );
112124 nodesDBStats = std::move (other.nodesDBStats );
113125 leafPreimagesDBStats = std::move (other.leafPreimagesDBStats );
@@ -121,9 +133,10 @@ struct TreeDBStats {
121133
122134 friend std::ostream& operator <<(std::ostream& os, const TreeDBStats& stats)
123135 {
124- os << " Map Size: " << stats.mapSize << " Blocks DB " << stats.blocksDBStats << " , Nodes DB "
125- << stats.nodesDBStats << " , Leaf Pre-images DB " << stats.leafPreimagesDBStats << " , Leaf Indices DB "
126- << stats.leafIndicesDBStats << " , Block Indices DB " << stats.blockIndicesDBStats ;
136+ os << " Map Size: " << stats.mapSize << " , Physical File Size: " << stats.physicalFileSize << " Blocks DB "
137+ << stats.blocksDBStats << " , Nodes DB " << stats.nodesDBStats << " , Leaf Pre-images DB "
138+ << stats.leafPreimagesDBStats << " , Leaf Indices DB " << stats.leafIndicesDBStats << " , Block Indices DB "
139+ << stats.blockIndicesDBStats ;
127140 return os;
128141 }
129142};
0 commit comments