transaction_pool/status.rs
1// Copyright 2020 Parity Technologies
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9/// Light pool status.
10/// This status is cheap to compute and can be called frequently.
11#[derive(Default, Debug, Clone, PartialEq, Eq)]
12pub struct LightStatus {
13 /// Memory usage in bytes.
14 pub mem_usage: usize,
15 /// Total number of transactions in the pool.
16 pub transaction_count: usize,
17 /// Number of unique senders in the pool.
18 pub senders: usize,
19}
20
21/// A full queue status.
22/// To compute this status it is required to provide `Ready`.
23/// NOTE: To compute the status we need to visit each transaction in the pool.
24#[derive(Default, Debug, Clone, PartialEq, Eq)]
25pub struct Status {
26 /// Number of stalled transactions.
27 pub stalled: usize,
28 /// Number of pending (ready) transactions.
29 pub pending: usize,
30 /// Number of future (not ready) transactions.
31 pub future: usize,
32}