Rate limit transaction counters (#5447)
* Rate limit transaction counters * @sakridge feedback * Set default high metrics rate for multinode demo * Fix tests * Swap defaults and fix env var tests * Only set metrics rate if not already set
This commit is contained in:
@ -4,7 +4,7 @@ use crate::exchange_instruction::*;
|
||||
use crate::exchange_state::*;
|
||||
use crate::faucet;
|
||||
use log::*;
|
||||
use solana_metrics::inc_new_counter_info;
|
||||
use solana_metrics::inc_new_high_rate_counter_info;
|
||||
use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::instruction::InstructionError;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
@ -296,7 +296,7 @@ impl ExchangeProcessor {
|
||||
// Trade holds the tokens in escrow
|
||||
account.tokens[from_token] -= info.tokens;
|
||||
|
||||
inc_new_counter_info!("exchange_processor-trades", 1, 1000, 1000);
|
||||
inc_new_high_rate_counter_info!("exchange_processor-trades", 1);
|
||||
|
||||
Self::serialize(
|
||||
&ExchangeState::Trade(OrderInfo {
|
||||
@ -390,7 +390,7 @@ impl ExchangeProcessor {
|
||||
Err(e)?
|
||||
}
|
||||
|
||||
inc_new_counter_info!("exchange_processor-swaps", 1, 1000, 1000);
|
||||
inc_new_high_rate_counter_info!("exchange_processor-swaps", 1);
|
||||
|
||||
if to_order.tokens == 0 {
|
||||
// Turn into token account
|
||||
|
Reference in New Issue
Block a user