Rate limit counter metrics points to one per second (#5496)

* Rate limit counter metrics points to one per second

* Remove old env var

* Test that metrics counter is incrementing

* Fix typo
This commit is contained in:
Justin Starry
2019-08-12 18:15:34 -04:00
committed by GitHub
parent 771d1a78fd
commit 0fde19239b
12 changed files with 209 additions and 163 deletions

View File

@ -4,7 +4,7 @@ use crate::exchange_instruction::*;
use crate::exchange_state::*;
use crate::faucet;
use log::*;
use solana_metrics::inc_new_high_rate_counter_info;
use solana_metrics::inc_new_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_high_rate_counter_info!("exchange_processor-trades", 1);
inc_new_counter_info!("exchange_processor-trades", 1);
Self::serialize(
&ExchangeState::Trade(OrderInfo {
@ -390,7 +390,7 @@ impl ExchangeProcessor {
Err(e)?
}
inc_new_high_rate_counter_info!("exchange_processor-swaps", 1);
inc_new_counter_info!("exchange_processor-swaps", 1);
if to_order.tokens == 0 {
// Turn into token account