@@ -1008,7 +1008,11 @@ impl Queue {
1008
1008
/// to fill up before writing them to maximize the chances that we build
1009
1009
/// a 'full' write batch, i.e., one that is either big enough or old
1010
1010
/// enough
1011
- async fn push_write ( & self , batch : Batch ) -> Result < ( ) , StoreError > {
1011
+ async fn push_write (
1012
+ & self ,
1013
+ batch : Batch ,
1014
+ stopwatch : & StopwatchMetrics ,
1015
+ ) -> Result < ( ) , StoreError > {
1012
1016
let batch = if ENV_VARS . store . write_batch_size == 0
1013
1017
|| ENV_VARS . store . write_batch_duration . is_zero ( )
1014
1018
|| !self . batch_writes ( )
@@ -1049,6 +1053,8 @@ impl Queue {
1049
1053
match existing. try_write ( ) {
1050
1054
Ok ( mut existing) => {
1051
1055
if existing. weight ( ) < ENV_VARS . store . write_batch_size {
1056
+ let _section =
1057
+ stopwatch. start_section ( "transact_block:append_batch" ) ;
1052
1058
let res = existing. append ( batch) . map ( |( ) | None ) ;
1053
1059
if existing. weight ( ) >= ENV_VARS . store . write_batch_size {
1054
1060
self . batch_ready_notify . notify_one ( ) ;
@@ -1369,7 +1375,7 @@ impl Writer {
1369
1375
Writer :: Sync ( store) => store. transact_block_operations ( & batch, stopwatch) ,
1370
1376
Writer :: Async { queue, .. } => {
1371
1377
self . check_queue_running ( ) ?;
1372
- queue. push_write ( batch) . await
1378
+ queue. push_write ( batch, stopwatch ) . await
1373
1379
}
1374
1380
}
1375
1381
}
@@ -1698,16 +1704,19 @@ impl WritableStoreTrait for WritableStore {
1698
1704
}
1699
1705
}
1700
1706
1701
- let batch = Batch :: new (
1702
- block_ptr_to. clone ( ) ,
1703
- block_time,
1704
- firehose_cursor. clone ( ) ,
1705
- mods,
1706
- data_sources,
1707
- deterministic_errors,
1708
- processed_data_sources,
1709
- is_non_fatal_errors_active,
1710
- ) ?;
1707
+ let batch = {
1708
+ let _section = stopwatch. start_section ( "transact_block:batch_new" ) ;
1709
+ Batch :: new (
1710
+ block_ptr_to. clone ( ) ,
1711
+ block_time,
1712
+ firehose_cursor. clone ( ) ,
1713
+ mods,
1714
+ data_sources,
1715
+ deterministic_errors,
1716
+ processed_data_sources,
1717
+ is_non_fatal_errors_active,
1718
+ ) ?
1719
+ } ;
1711
1720
self . writer . write ( batch, stopwatch) . await ?;
1712
1721
1713
1722
* self . block_ptr . lock ( ) . unwrap ( ) = Some ( block_ptr_to) ;
0 commit comments