Allow metrics rate to differ from log rate (#3993)

And reduce metrics rate for exchange contract counters.
Since we can go 10s-100s thousands of contracts per second,
some metrics would be dropped if submitting every time.
This commit is contained in:
sakridge
2019-04-25 16:58:49 -07:00
committed by GitHub
parent aa0b67c93c
commit fd60ef8a8d
2 changed files with 43 additions and 26 deletions

View File

@ -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);
inc_new_counter_info!("exchange_processor-trades", 1, 1000, 1000);
Self::serialize(
&ExchangeState::Trade(TradeOrderInfo {
@ -390,7 +390,7 @@ impl ExchangeProcessor {
Err(e)?
}
inc_new_counter_info!("exchange_processor-swap", 1);
inc_new_counter_info!("exchange_processor-swap", 1, 1000, 1000);
if to_trade.tokens == 0 {
// Turn into token account