@@ -40,6 +40,7 @@ const REGION_ID: &str = "region_id";
4040const TABLE_ID : & str = "table_id" ;
4141const REGION_NUMBER : & str = "region_number" ;
4242const REGION_ROWS : & str = "region_rows" ;
43+ const WRITTEN_BYTES : & str = "written_bytes_since_open" ;
4344const DISK_SIZE : & str = "disk_size" ;
4445const MEMTABLE_SIZE : & str = "memtable_size" ;
4546const MANIFEST_SIZE : & str = "manifest_size" ;
@@ -57,6 +58,7 @@ const INIT_CAPACITY: usize = 42;
5758/// - `table_id`: The table id.
5859/// - `region_number`: The region number.
5960/// - `region_rows`: The number of rows in region.
61+ /// - `written_bytes_since_open`: The total bytes written of the region since region opened.
6062/// - `memtable_size`: The memtable size in bytes.
6163/// - `disk_size`: The approximate disk size in bytes.
6264/// - `manifest_size`: The manifest size in bytes.
@@ -84,6 +86,7 @@ impl InformationSchemaRegionStatistics {
8486 ColumnSchema :: new( TABLE_ID , ConcreteDataType :: uint32_datatype( ) , false ) ,
8587 ColumnSchema :: new( REGION_NUMBER , ConcreteDataType :: uint32_datatype( ) , false ) ,
8688 ColumnSchema :: new( REGION_ROWS , ConcreteDataType :: uint64_datatype( ) , true ) ,
89+ ColumnSchema :: new( WRITTEN_BYTES , ConcreteDataType :: uint64_datatype( ) , true ) ,
8790 ColumnSchema :: new( DISK_SIZE , ConcreteDataType :: uint64_datatype( ) , true ) ,
8891 ColumnSchema :: new( MEMTABLE_SIZE , ConcreteDataType :: uint64_datatype( ) , true ) ,
8992 ColumnSchema :: new( MANIFEST_SIZE , ConcreteDataType :: uint64_datatype( ) , true ) ,
@@ -147,6 +150,7 @@ struct InformationSchemaRegionStatisticsBuilder {
147150 table_ids : UInt32VectorBuilder ,
148151 region_numbers : UInt32VectorBuilder ,
149152 region_rows : UInt64VectorBuilder ,
153+ written_bytes : UInt64VectorBuilder ,
150154 disk_sizes : UInt64VectorBuilder ,
151155 memtable_sizes : UInt64VectorBuilder ,
152156 manifest_sizes : UInt64VectorBuilder ,
@@ -166,6 +170,7 @@ impl InformationSchemaRegionStatisticsBuilder {
166170 table_ids : UInt32VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
167171 region_numbers : UInt32VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
168172 region_rows : UInt64VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
173+ written_bytes : UInt64VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
169174 disk_sizes : UInt64VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
170175 memtable_sizes : UInt64VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
171176 manifest_sizes : UInt64VectorBuilder :: with_capacity ( INIT_CAPACITY ) ,
@@ -197,6 +202,7 @@ impl InformationSchemaRegionStatisticsBuilder {
197202 ( TABLE_ID , & Value :: from ( region_stat. id . table_id ( ) ) ) ,
198203 ( REGION_NUMBER , & Value :: from ( region_stat. id . region_number ( ) ) ) ,
199204 ( REGION_ROWS , & Value :: from ( region_stat. num_rows ) ) ,
205+ ( WRITTEN_BYTES , & Value :: from ( region_stat. written_bytes ) ) ,
200206 ( DISK_SIZE , & Value :: from ( region_stat. approximate_bytes ) ) ,
201207 ( MEMTABLE_SIZE , & Value :: from ( region_stat. memtable_size ) ) ,
202208 ( MANIFEST_SIZE , & Value :: from ( region_stat. manifest_size ) ) ,
@@ -216,6 +222,7 @@ impl InformationSchemaRegionStatisticsBuilder {
216222 self . region_numbers
217223 . push ( Some ( region_stat. id . region_number ( ) ) ) ;
218224 self . region_rows . push ( Some ( region_stat. num_rows ) ) ;
225+ self . written_bytes . push ( Some ( region_stat. written_bytes ) ) ;
219226 self . disk_sizes . push ( Some ( region_stat. approximate_bytes ) ) ;
220227 self . memtable_sizes . push ( Some ( region_stat. memtable_size ) ) ;
221228 self . manifest_sizes . push ( Some ( region_stat. manifest_size ) ) ;
@@ -232,6 +239,7 @@ impl InformationSchemaRegionStatisticsBuilder {
232239 Arc :: new( self . table_ids. finish( ) ) ,
233240 Arc :: new( self . region_numbers. finish( ) ) ,
234241 Arc :: new( self . region_rows. finish( ) ) ,
242+ Arc :: new( self . written_bytes. finish( ) ) ,
235243 Arc :: new( self . disk_sizes. finish( ) ) ,
236244 Arc :: new( self . memtable_sizes. finish( ) ) ,
237245 Arc :: new( self . manifest_sizes. finish( ) ) ,
0 commit comments