1use diem_metrics::{
9 register_histogram_vec, register_int_counter, register_int_gauge,
10 register_int_gauge_vec, HistogramVec, IntCounter, IntGauge, IntGaugeVec,
11};
12use once_cell::sync::Lazy;
13
14pub static DIEM_STORAGE_LEDGER: Lazy<IntGaugeVec> = Lazy::new(|| {
15 register_int_gauge_vec!(
16 "diem_storage_ledger",
18 "Diem storage ledger counters",
20 &["type"]
22 )
23 .unwrap()
24});
25
26pub static DIEM_STORAGE_COMMITTED_TXNS: Lazy<IntCounter> = Lazy::new(|| {
27 register_int_counter!(
28 "diem_storage_committed_txns",
29 "Diem storage committed transactions"
30 )
31 .unwrap()
32});
33
34pub static DIEM_STORAGE_LATEST_TXN_VERSION: Lazy<IntGauge> = Lazy::new(|| {
35 register_int_gauge!(
36 "diem_storage_latest_transaction_version",
37 "Diem storage latest transaction version"
38 )
39 .unwrap()
40});
41
42pub static DIEM_STORAGE_LEDGER_VERSION: Lazy<IntGauge> = Lazy::new(|| {
43 register_int_gauge!(
44 "diem_storage_ledger_version",
45 "Version in the latest saved ledger info."
46 )
47 .unwrap()
48});
49
50pub static DIEM_STORAGE_NEXT_BLOCK_EPOCH: Lazy<IntGauge> = Lazy::new(|| {
51 register_int_gauge!(
52 "diem_storage_next_block_epoch",
53 "ledger_info.next_block_epoch() for the latest saved ledger info."
54 )
55 .unwrap()
56});
57
58pub static DIEM_STORAGE_PRUNE_WINDOW: Lazy<IntGauge> = Lazy::new(|| {
59 register_int_gauge!(
60 "diem_storage_prune_window",
61 "Diem storage prune window"
62 )
63 .unwrap()
64});
65
66pub static DIEM_STORAGE_PRUNER_LEAST_READABLE_STATE_VERSION: Lazy<IntGauge> =
67 Lazy::new(|| {
68 register_int_gauge!(
69 "diem_storage_pruner_least_readable_state_version",
70 "Diem storage pruner least readable state version"
71 )
72 .unwrap()
73 });
74
75pub static DIEM_STORAGE_API_LATENCY_SECONDS: Lazy<HistogramVec> =
76 Lazy::new(|| {
77 register_histogram_vec!(
78 "diem_storage_api_latency_seconds",
80 "Diem storage api latency in seconds",
82 &["api_name", "result"]
84 )
85 .unwrap()
86 });
87
88pub static DIEM_STORAGE_OTHER_TIMERS_SECONDS: Lazy<HistogramVec> =
89 Lazy::new(|| {
90 register_histogram_vec!(
91 "diem_storage_other_timers_seconds",
93 "Various timers below public API level.",
95 &["name"]
97 )
98 .unwrap()
99 });
100
101pub static DIEM_STORAGE_ROCKSDB_PROPERTIES: Lazy<IntGaugeVec> =
103 Lazy::new(|| {
104 register_int_gauge_vec!(
105 "diem_rocksdb_properties",
107 "rocksdb integer properties",
109 &["cf_name", "property_name",]
111 )
112 .unwrap()
113 });
114
115pub(crate) static BACKUP_EPOCH_ENDING_EPOCH: Lazy<IntGauge> = Lazy::new(|| {
118 register_int_gauge!(
119 "diem_backup_handler_epoch_ending_epoch",
120 "Current epoch returned in an epoch ending backup."
121 )
122 .unwrap()
123});
124
125pub(crate) static BACKUP_TXN_VERSION: Lazy<IntGauge> = Lazy::new(|| {
126 register_int_gauge!(
127 "diem_backup_handler_transaction_version",
128 "Current version returned in a transaction backup."
129 )
130 .unwrap()
131});
132
133pub(crate) static BACKUP_STATE_SNAPSHOT_VERSION: Lazy<IntGauge> =
134 Lazy::new(|| {
135 register_int_gauge!(
136 "diem_backup_handler_state_snapshot_version",
137 "Version of requested state snapshot backup."
138 )
139 .unwrap()
140 });
141
142pub(crate) static BACKUP_STATE_SNAPSHOT_LEAF_IDX: Lazy<IntGauge> =
143 Lazy::new(|| {
144 register_int_gauge!(
145 "diem_backup_handler_state_snapshot_leaf_index",
146 "Index of current leaf index returned in a state snapshot backup."
147 )
148 .unwrap()
149 });