snarkos_node_metrics/
names.rs

1// Copyright (c) 2019-2025 Provable Inc.
2// This file is part of the snarkOS library.
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at:
7
8// http://www.apache.org/licenses/LICENSE-2.0
9
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16pub(super) const COUNTER_NAMES: [&str; 3] =
17    [bft::LEADERS_ELECTED, consensus::STALE_UNCONFIRMED_TRANSACTIONS, consensus::STALE_UNCONFIRMED_SOLUTIONS];
18
19pub(super) const GAUGE_NAMES: [&str; 26] = [
20    bft::CONNECTED,
21    bft::CONNECTING,
22    bft::LAST_STORED_ROUND,
23    bft::PROPOSAL_ROUND,
24    bft::CERTIFIED_BATCHES,
25    bft::HEIGHT,
26    bft::LAST_COMMITTED_ROUND,
27    bft::IS_SYNCED,
28    blocks::SOLUTIONS,
29    blocks::TRANSACTIONS,
30    blocks::ACCEPTED_DEPLOY,
31    blocks::ACCEPTED_EXECUTE,
32    blocks::REJECTED_DEPLOY,
33    blocks::REJECTED_EXECUTE,
34    blocks::ABORTED_TRANSACTIONS,
35    blocks::ABORTED_SOLUTIONS,
36    blocks::PROOF_TARGET,
37    blocks::COINBASE_TARGET,
38    blocks::CUMULATIVE_PROOF_TARGET,
39    consensus::COMMITTED_CERTIFICATES,
40    consensus::UNCONFIRMED_SOLUTIONS,
41    consensus::UNCONFIRMED_TRANSACTIONS,
42    router::CONNECTED,
43    router::CANDIDATE,
44    router::RESTRICTED,
45    tcp::TCP_TASKS,
46];
47
48pub(super) const HISTOGRAM_NAMES: [&str; 4] =
49    [bft::COMMIT_ROUNDS_LATENCY, consensus::CERTIFICATE_COMMIT_LATENCY, consensus::BLOCK_LATENCY, consensus::BLOCK_LAG];
50
51pub mod bft {
52    pub const COMMIT_ROUNDS_LATENCY: &str = "snarkos_bft_commit_rounds_latency_secs"; // <-- This one doesn't even make sense.
53    pub const CONNECTED: &str = "snarkos_bft_connected_total";
54    pub const CONNECTING: &str = "snarkos_bft_connecting_total";
55    pub const LAST_STORED_ROUND: &str = "snarkos_bft_last_stored_round";
56    pub const LEADERS_ELECTED: &str = "snarkos_bft_leaders_elected_total";
57    pub const PROPOSAL_ROUND: &str = "snarkos_bft_primary_proposal_round";
58    pub const CERTIFIED_BATCHES: &str = "snarkos_bft_primary_certified_batches";
59    pub const HEIGHT: &str = "snarkos_bft_height_total";
60    pub const LAST_COMMITTED_ROUND: &str = "snarkos_bft_last_committed_round";
61    pub const IS_SYNCED: &str = "snarkos_bft_is_synced";
62}
63
64pub mod blocks {
65    pub const TRANSACTIONS: &str = "snarkos_blocks_transactions_total";
66    pub const SOLUTIONS: &str = "snarkos_blocks_solutions_total";
67    pub const ACCEPTED_DEPLOY: &str = "snarkos_blocks_accepted_deploy";
68    pub const ACCEPTED_EXECUTE: &str = "snarkos_blocks_accepted_execute";
69    pub const REJECTED_DEPLOY: &str = "snarkos_blocks_rejected_deploy";
70    pub const REJECTED_EXECUTE: &str = "snarkos_blocks_rejected_execute";
71    pub const ABORTED_TRANSACTIONS: &str = "snarkos_blocks_aborted_transactions";
72    pub const ABORTED_SOLUTIONS: &str = "snarkos_blocks_aborted_solutions";
73    pub const PROOF_TARGET: &str = "snarkos_blocks_proof_target";
74    pub const COINBASE_TARGET: &str = "snarkos_blocks_coinbase_target";
75    pub const CUMULATIVE_PROOF_TARGET: &str = "snarkos_blocks_cumulative_proof_target";
76}
77
78pub mod consensus {
79    pub const CERTIFICATE_COMMIT_LATENCY: &str = "snarkos_consensus_certificate_commit_latency_secs";
80    pub const COMMITTED_CERTIFICATES: &str = "snarkos_consensus_committed_certificates_total";
81    pub const BLOCK_LATENCY: &str = "snarkos_consensus_block_latency_secs";
82    pub const BLOCK_LAG: &str = "snarkos_consensus_block_lag_ms";
83    pub const UNCONFIRMED_TRANSACTIONS: &str = "snarkos_consensus_unconfirmed_transactions_total";
84    pub const UNCONFIRMED_SOLUTIONS: &str = "snarkos_consensus_unconfirmed_solutions_total";
85    pub const TRANSMISSION_LATENCY: &str = "snarkos_consensus_transmission_latency";
86    pub const STALE_UNCONFIRMED_TRANSACTIONS: &str = "snarkos_consensus_stale_unconfirmed_transactions";
87    pub const STALE_UNCONFIRMED_SOLUTIONS: &str = "snarkos_consensus_stale_unconfirmed_solutions";
88    pub const VALIDATOR_PARTICIPATION: &str = "snarkos_consensus_validator_participation";
89}
90
91pub mod router {
92    pub const CONNECTED: &str = "snarkos_router_connected_total";
93    pub const CANDIDATE: &str = "snarkos_router_candidate_total";
94    pub const RESTRICTED: &str = "snarkos_router_restricted_total";
95}
96
97pub mod tcp {
98    pub const TCP_TASKS: &str = "snarkos_tcp_tasks_total";
99}