@@ -34,13 +34,15 @@ class block_stats
34
34
end_work = fc::time_point::now ();
35
35
}
36
36
37
- void on_cleanup ( uint32_t _exp_txs, uint32_t _fail_txs, uint32_t _ok_txs, uint32_t _post_txs, uint32_t _lib )
37
+ void on_cleanup ( uint32_t _exp_txs, uint32_t _fail_txs, uint32_t _ok_txs, uint32_t _post_txs, uint32_t _drop_txs, size_t _mempool_size, uint32_t _lib )
38
38
{
39
39
end_cleanup = fc::time_point::now ();
40
40
txs_expired = _exp_txs;
41
41
txs_failed = _fail_txs;
42
42
txs_reapplied = _ok_txs;
43
43
txs_postponed = _post_txs;
44
+ txs_dropped = _drop_txs;
45
+ txs_size = _mempool_size;
44
46
last_irreversible_block_num = _lib;
45
47
}
46
48
@@ -62,6 +64,9 @@ class block_stats
62
64
uint32_t get_txs_failed_after_block () const { return txs_failed; }
63
65
uint32_t get_txs_reapplied_after_block () const { return txs_reapplied; }
64
66
uint32_t get_txs_postponed_after_block () const { return txs_postponed; }
67
+ uint32_t get_txs_dropped_after_block () const { return txs_dropped; }
68
+
69
+ size_t get_size_of_txs_left_after_block () const { return txs_size; }
65
70
66
71
uint32_t get_last_irreversible_block_num () const { return last_irreversible_block_num; }
67
72
@@ -91,6 +96,12 @@ class block_stats
91
96
uint32_t txs_reapplied = 0 ;
92
97
// number of transactions that were not touched during pending reapplication due to time limit
93
98
uint32_t txs_postponed = 0 ;
99
+ // number of would-be-postponed transactions that were dropped during pending reapplication due to mempool size limit
100
+ uint32_t txs_dropped = 0 ;
101
+
102
+ // sum of packed sizes of transactions left in mempool after pending reapplication
103
+ size_t txs_size = 0 ;
104
+
94
105
// last irreversible block at the time block work was done
95
106
uint32_t last_irreversible_block_num = 0 ;
96
107
};
@@ -150,7 +161,7 @@ class block_flow_control
150
161
virtual void on_end_of_apply_block () const ;
151
162
152
163
// after reapplication of pending transactions (only overridden in tests)
153
- virtual void on_end_of_processing ( uint32_t _exp_txs, uint32_t _fail_txs, uint32_t _ok_txs, uint32_t _post_txs, uint32_t _lib ) const ;
164
+ virtual void on_end_of_processing ( uint32_t _exp_txs, uint32_t _fail_txs, uint32_t _ok_txs, uint32_t _post_txs, uint32_t _drop_txs, size_t _mempool_size, uint32_t _lib ) const ;
154
165
155
166
// in case of exception
156
167
virtual void on_failure ( const fc::exception & e ) const ;
0 commit comments