Use log levels for datapoint metrics (#4335)

* Use log levels for datapoint metrics

* address review comments

* fix cyclomatic complexity
This commit is contained in:
Pankaj Garg
2019-05-17 17:34:05 -07:00
committed by GitHub
parent 788290ad82
commit 9476fe5ce3
16 changed files with 163 additions and 123 deletions

View File

@ -6,7 +6,7 @@ use crate::vote_state::{self, Vote, VoteState};
use bincode::deserialize;
use log::*;
use serde_derive::{Deserialize, Serialize};
use solana_metrics::datapoint;
use solana_metrics::datapoint_warn;
use solana_sdk::account::KeyedAccount;
use solana_sdk::instruction::{AccountMeta, Instruction, InstructionError};
use solana_sdk::pubkey::Pubkey;
@ -88,7 +88,7 @@ pub fn process_instruction(
vote_state::authorize_voter(vote_account, other_signers, &voter_id)
}
VoteInstruction::Vote(votes) => {
datapoint!("vote-native", ("count", 1, i64));
datapoint_warn!("vote-native", ("count", 1, i64));
let (vote_account, other_signers) = keyed_accounts.split_at_mut(1);
let vote_account = &mut vote_account[0];