Skip to content

Commit

Permalink
Remove ability to submit metrics with no fields (solana-labs#35133)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Feb 16, 2024
1 parent d268139 commit 2a9ed3e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
23 changes: 0 additions & 23 deletions metrics/src/datapoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,10 @@ macro_rules! create_datapoint {
point
}
};
(@point $name:expr $(,)?) => {
$crate::datapoint::DataPoint::new(&$name)
};
}

#[macro_export]
macro_rules! datapoint {
($level:expr, $name:expr $(,)?) => {
if log::log_enabled!($level) {
$crate::submit($crate::create_datapoint!(@point $name), $level);
}
};
($level:expr, $name:expr, $($fields:tt)+) => {
if log::log_enabled!($level) {
$crate::submit($crate::create_datapoint!(@point $name, $($fields)+), $level);
Expand All @@ -178,49 +170,34 @@ macro_rules! datapoint {
}
#[macro_export]
macro_rules! datapoint_error {
($name:expr $(,)?) => {
$crate::datapoint!(log::Level::Error, $name);
};
($name:expr, $($fields:tt)+) => {
$crate::datapoint!(log::Level::Error, $name, $($fields)+);
};
}

#[macro_export]
macro_rules! datapoint_warn {
($name:expr $(,)?) => {
$crate::datapoint!(log::Level::Warn, $name);
};
($name:expr, $($fields:tt)+) => {
$crate::datapoint!(log::Level::Warn, $name, $($fields)+);
};
}

#[macro_export]
macro_rules! datapoint_info {
($name:expr) => {
$crate::datapoint!(log::Level::Info, $name);
};
($name:expr, $($fields:tt)+) => {
$crate::datapoint!(log::Level::Info, $name, $($fields)+);
};
}

#[macro_export]
macro_rules! datapoint_debug {
($name:expr) => {
$crate::datapoint!(log::Level::Debug, $name);
};
($name:expr, $($fields:tt)+) => {
$crate::datapoint!(log::Level::Debug, $name, $($fields)+);
};
}

#[macro_export]
macro_rules! datapoint_trace {
($name:expr) => {
$crate::datapoint!(log::Level::Trace, $name);
};
($name:expr, $($fields:tt)+) => {
$crate::datapoint!(log::Level::Trace, $name, $($fields)+);
};
Expand Down
2 changes: 0 additions & 2 deletions send-transaction-service/src/send_transaction_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use {
tpu_connection::TpuConnection,
},
solana_measure::measure::Measure,
solana_metrics::datapoint_warn,
solana_runtime::{bank::Bank, bank_forks::BankForks},
solana_sdk::{
clock::Slot, hash::Hash, nonce_account, pubkey::Pubkey, saturating_add_assign,
Expand Down Expand Up @@ -481,7 +480,6 @@ impl SendTransactionService {
let entry = retry_transactions.entry(signature);
if let Entry::Vacant(_) = entry {
if retry_len >= config.retry_pool_max_size {
datapoint_warn!("send_transaction_service-queue-overflow");
break;
} else {
transaction_info.last_sent_time = Some(last_sent_time);
Expand Down

0 comments on commit 2a9ed3e

Please sign in to comment.