Skip to content

Commit 9482238

Browse files
authored
feat: mempool stats endpoint and prometheus metrics (#1241)
* feat: implement endpoint for various mempool stats * chore: remove coinbase tx entries from mempool stats (will always be empty) * chore: update prometheus mempool stats on new block, microblock, and mempool tx * chore: add mempool tx byte size stats * chore: add indexes to speedup mempool table queries * chore: move `registerMempoolPromStats` fn to db helper module * docs: add OpenAPI schema for new mempool stats endpoint * chore: tests for mempool stats endpoint * chore: restore mempool garbage collect env var after test * chore: bytea serialization tests * chore: strict hex string handling for bytea value serializer * chore: improved mempool_tx indexing * chore: unit test fix
1 parent 35797be commit 9482238

19 files changed

+1193
-102
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"tx_type_counts": {
3+
"token_transfer": 130,
4+
"smart_contract": 2,
5+
"contract_call": 310,
6+
"poison_microblock": 0
7+
},
8+
"tx_simple_fee_averages": {
9+
"token_transfer": {
10+
"p25": 3000,
11+
"p50": 3000,
12+
"p75": 6000,
13+
"p95": 401199.9999999995
14+
},
15+
"smart_contract": {
16+
"p25": 837500,
17+
"p50": 925000,
18+
"p75": 1012500,
19+
"p95": 1082500
20+
},
21+
"contract_call": {
22+
"p25": 3000,
23+
"p50": 10368,
24+
"p75": 100000,
25+
"p95": 1000000
26+
},
27+
"poison_microblock": {
28+
"p25": null,
29+
"p50": null,
30+
"p75": null,
31+
"p95": null
32+
}
33+
},
34+
"tx_ages": {
35+
"token_transfer": {
36+
"p25": 167.5,
37+
"p50": 45,
38+
"p75": 1,
39+
"p95": 0
40+
},
41+
"smart_contract": {
42+
"p25": 185.5,
43+
"p50": 129,
44+
"p75": 72.5,
45+
"p95": 27.30000000000001
46+
},
47+
"contract_call": {
48+
"p25": 189,
49+
"p50": 127.5,
50+
"p75": 9.5,
51+
"p95": 0
52+
},
53+
"poison_microblock": {
54+
"p25": null,
55+
"p50": null,
56+
"p75": null,
57+
"p95": null
58+
}
59+
},
60+
"tx_byte_sizes": {
61+
"token_transfer": {
62+
"p25": 180,
63+
"p50": 180,
64+
"p75": 180,
65+
"p95": 180
66+
},
67+
"smart_contract": {
68+
"p25": 706.75,
69+
"p50": 814.5,
70+
"p75": 922.25,
71+
"p95": 1008.45
72+
},
73+
"contract_call": {
74+
"p25": 291,
75+
"p50": 435,
76+
"p75": 462,
77+
"p95": 597
78+
},
79+
"poison_microblock": {
80+
"p25": null,
81+
"p50": null,
82+
"p75": null,
83+
"p95": null
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)