Skip to content

Commit

Permalink
Rollback - re-renaming the feature gate to monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jun 17, 2020
1 parent 7cbbe86 commit 60074c7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ criterion = "0.3"
[features]
developer-mode = []
default = ["developer-mode"]
prometheus = ["prometheus"]
monitoring = ["prometheus"]

[target.'cfg(all(target_arch = "x86_64", not(target_env = "msvc")))'.dependencies]
sha2-asm = "0.5.3"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN rustup target add x86_64-unknown-linux-musl && \
RUN CC=musl-gcc \
CC_x86_64_unknown_linux_musl=musl-gcc \
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
cargo build --features "prometheus" --release --target x86_64-unknown-linux-musl --workspace=./
cargo build --features "monitoring" --release --target x86_64-unknown-linux-musl --workspace=./

RUN cd /src/target/x86_64-unknown-linux-musl/release && \
mkdir /out && \
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern crate percent_encoding;
#[macro_use]
extern crate assert_json_diff;

#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
#[macro_use] pub extern crate prometheus;

#[macro_use]
Expand Down
22 changes: 11 additions & 11 deletions src/monitoring/mod.rs
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
mod prometheus;

pub fn increment_rpc_calls_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::RPC_CALL_COUNTER.inc();
}

pub fn increment_p2p_control_plan_msg_received_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::P2P_CONTROL_PLAN_MSG_RECEIVED_COUNTER.inc();
}

pub fn increment_p2p_data_plan_msg_received_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::P2P_DATA_PLAN_MSG_RECEIVED_COUNTER.inc();
}

pub fn increment_txs_received_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::TXS_RECEIVED_COUNTER.inc();
}

pub fn increment_btc_blocks_received_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::BTC_BLOCKS_RECEIVED_COUNTER.inc();
}

pub fn increment_btc_ops_sent_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::BTC_OPS_SENT_COUNTER.inc();
}

pub fn increment_stx_blocks_processed_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::STX_BLOCKS_PROCESSED_COUNTER.inc();
}

pub fn increment_stx_blocks_mined_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::STX_BLOCKS_MINED_COUNTER.inc();
}

pub fn increment_warning_emitted_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::WARNING_EMITTED_COUNTER.inc();
}

pub fn increment_errors_emitted_counter() {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::ERRORS_EMITTED_COUNTER.inc();
}
2 changes: 1 addition & 1 deletion testnet/stacks-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ name = "stacks-node"
path = "src/main.rs"

[features]
prometheus = ["stacks/prometheus"]
monitoring = ["stacks/monitoring"]
default = []
4 changes: 2 additions & 2 deletions testnet/stacks-node/src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pub use stacks::monitoring::{
increment_errors_emitted_counter
};

#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
mod prometheus;

pub fn start_serving_monitoring_metrics(bind_address: String) {
#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
prometheus::start_serving_prometheus_metrics(bind_address);
}
2 changes: 1 addition & 1 deletion testnet/stacks-node/src/run_loop/neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use stacks::burnchains::bitcoin::{BitcoinNetworkType,

use super::RunLoopCallbacks;

#[cfg(feature = "prometheus")]
#[cfg(feature = "monitoring")]
use crate::monitoring::start_serving_monitoring_metrics;

/// Coordinating a node running in neon mode.
Expand Down

0 comments on commit 60074c7

Please sign in to comment.