parent
0ace22d03f
commit
aa80f69171
|
@ -7,7 +7,7 @@ use solana_faucet::faucet::request_airdrop_transaction;
|
|||
#[cfg(feature = "move")]
|
||||
use solana_librapay::{create_genesis, upload_mint_script, upload_payment_script};
|
||||
use solana_measure::measure::Measure;
|
||||
use solana_metrics::{self, datapoint_debug};
|
||||
use solana_metrics::{self, datapoint_info};
|
||||
use solana_sdk::{
|
||||
client::Client,
|
||||
clock::{DEFAULT_TICKS_PER_SECOND, DEFAULT_TICKS_PER_SLOT, MAX_PROCESSING_AGE},
|
||||
|
@ -244,7 +244,7 @@ where
|
|||
|
||||
fn metrics_submit_lamport_balance(lamport_balance: u64) {
|
||||
info!("Token balance: {}", lamport_balance);
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"bench-tps-lamport_balance",
|
||||
("balance", lamport_balance, i64)
|
||||
);
|
||||
|
@ -375,7 +375,7 @@ fn generate_txs(
|
|||
duration_as_ms(&duration),
|
||||
blockhash,
|
||||
);
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"bench-tps-generate_txs",
|
||||
("duration", duration_as_us(&duration), i64)
|
||||
);
|
||||
|
@ -481,7 +481,7 @@ fn do_tx_transfers<T: Client>(
|
|||
duration_as_ms(&transfer_start.elapsed()),
|
||||
tx_len as f32 / duration_as_s(&transfer_start.elapsed()),
|
||||
);
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"bench-tps-do_tx_transfers",
|
||||
("duration", duration_as_us(&transfer_start.elapsed()), i64),
|
||||
("count", tx_len, i64)
|
||||
|
|
|
@ -82,7 +82,7 @@ impl BroadcastRun for FailEntryVerificationBroadcastRun {
|
|||
// Broadcast data
|
||||
let all_shred_bufs: Vec<Vec<u8>> = shreds.to_vec().into_iter().map(|s| s.payload).collect();
|
||||
cluster_info
|
||||
.read()
|
||||
.write()
|
||||
.unwrap()
|
||||
.broadcast_shreds(sock, all_shred_bufs, &all_seeds, stakes)?;
|
||||
Ok(())
|
||||
|
|
|
@ -264,7 +264,7 @@ impl StandardBroadcastRun {
|
|||
trace!("Broadcasting {:?} shreds", shred_bufs.len());
|
||||
|
||||
cluster_info
|
||||
.read()
|
||||
.write()
|
||||
.unwrap()
|
||||
.broadcast_shreds(sock, shred_bufs, &seeds, stakes)?;
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ use solana_net_utils::{
|
|||
use solana_perf::packet::{to_packets_with_destination, Packets, PacketsRecycler};
|
||||
use solana_rayon_threadlimit::get_thread_count;
|
||||
use solana_sdk::hash::Hash;
|
||||
use solana_sdk::timing::duration_as_s;
|
||||
use solana_sdk::{
|
||||
clock::{Slot, DEFAULT_MS_PER_SLOT},
|
||||
pubkey::Pubkey,
|
||||
|
@ -98,6 +99,7 @@ pub struct ClusterInfo {
|
|||
pub(crate) keypair: Arc<Keypair>,
|
||||
/// The network entrypoint
|
||||
entrypoint: Option<ContactInfo>,
|
||||
last_datapoint_submit: Instant,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
|
@ -197,6 +199,7 @@ impl ClusterInfo {
|
|||
gossip: CrdsGossip::default(),
|
||||
keypair,
|
||||
entrypoint: None,
|
||||
last_datapoint_submit: Instant::now(),
|
||||
};
|
||||
let id = contact_info.id;
|
||||
me.gossip.set_self(&id);
|
||||
|
@ -917,7 +920,7 @@ impl ClusterInfo {
|
|||
/// broadcast messages from the leader to layer 1 nodes
|
||||
/// # Remarks
|
||||
pub fn broadcast_shreds(
|
||||
&self,
|
||||
&mut self,
|
||||
s: &UdpSocket,
|
||||
shreds: Vec<Vec<u8>>,
|
||||
seeds: &[[u8; 32]],
|
||||
|
@ -926,11 +929,14 @@ impl ClusterInfo {
|
|||
let (peers, peers_and_stakes) = self.sorted_tvu_peers_and_stakes(stakes);
|
||||
let broadcast_len = peers_and_stakes.len();
|
||||
if broadcast_len == 0 {
|
||||
datapoint_debug!(
|
||||
"cluster_info-num_nodes",
|
||||
("live_count", 1, i64),
|
||||
("broadcast_count", 1, i64)
|
||||
);
|
||||
if duration_as_s(&Instant::now().duration_since(self.last_datapoint_submit)) >= 1.0 {
|
||||
datapoint_info!(
|
||||
"cluster_info-num_nodes",
|
||||
("live_count", 1, i64),
|
||||
("broadcast_count", 1, i64)
|
||||
);
|
||||
self.last_datapoint_submit = Instant::now();
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
let mut packets: Vec<_> = shreds
|
||||
|
@ -960,11 +966,14 @@ impl ClusterInfo {
|
|||
num_live_peers += 1;
|
||||
}
|
||||
});
|
||||
datapoint_debug!(
|
||||
"cluster_info-num_nodes",
|
||||
("live_count", num_live_peers, i64),
|
||||
("broadcast_count", broadcast_len + 1, i64)
|
||||
);
|
||||
if duration_as_s(&Instant::now().duration_since(self.last_datapoint_submit)) >= 1.0 {
|
||||
datapoint_info!(
|
||||
"cluster_info-num_nodes",
|
||||
("live_count", num_live_peers, i64),
|
||||
("broadcast_count", broadcast_len + 1, i64)
|
||||
);
|
||||
self.last_datapoint_submit = Instant::now();
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use chrono::prelude::*;
|
||||
use solana_ledger::bank_forks::BankForks;
|
||||
use solana_metrics::datapoint_debug;
|
||||
use solana_runtime::bank::Bank;
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
|
@ -122,7 +121,7 @@ impl Tower {
|
|||
vote_state.nth_recent_vote(0).map(|v| v.slot).unwrap_or(0) as i64
|
||||
);
|
||||
debug!("observed root {}", vote_state.root_slot.unwrap_or(0) as i64);
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"tower-observed",
|
||||
(
|
||||
"slot",
|
||||
|
@ -241,7 +240,7 @@ impl Tower {
|
|||
self.lockouts.process_vote_unchecked(&vote);
|
||||
self.last_vote = vote;
|
||||
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"tower-vote",
|
||||
("latest", slot, i64),
|
||||
("root", self.lockouts.root_slot.unwrap_or(0), i64)
|
||||
|
|
|
@ -523,7 +523,7 @@ impl ReplayStage {
|
|||
return;
|
||||
}
|
||||
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"replay_stage-new_leader",
|
||||
("slot", poh_slot, i64),
|
||||
("leader", next_leader.to_string(), String),
|
||||
|
|
|
@ -298,7 +298,7 @@ impl ServeRepair {
|
|||
Ok(self.window_index_request_bytes(*slot, *shred_index)?)
|
||||
}
|
||||
RepairType::HighestShred(slot, shred_index) => {
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"serve_repair-repair_highest",
|
||||
("repair-highest-slot", *slot, i64),
|
||||
("repair-highest-ix", *shred_index, i64)
|
||||
|
@ -306,7 +306,7 @@ impl ServeRepair {
|
|||
Ok(self.window_highest_index_request_bytes(*slot, *shred_index)?)
|
||||
}
|
||||
RepairType::Orphan(slot) => {
|
||||
datapoint_debug!("serve_repair-repair_orphan", ("repair-orphan", *slot, i64));
|
||||
datapoint_info!("serve_repair-repair_orphan", ("repair-orphan", *slot, i64));
|
||||
Ok(self.orphan_bytes(*slot)?)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
pub mod vote_instruction;
|
||||
pub mod vote_state;
|
||||
|
||||
#[macro_use]
|
||||
extern crate solana_metrics;
|
||||
|
||||
use crate::vote_instruction::process_instruction;
|
||||
|
||||
solana_sdk::declare_program!(
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
use log::*;
|
||||
use num_derive::{FromPrimitive, ToPrimitive};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_metrics::datapoint_debug;
|
||||
use solana_metrics::inc_new_counter_info;
|
||||
use solana_sdk::{
|
||||
account::{get_signers, KeyedAccount},
|
||||
instruction::{AccountMeta, Instruction, InstructionError, WithSigner},
|
||||
|
@ -209,7 +209,7 @@ pub fn process_instruction(
|
|||
vote_state::update_node(me, &node_pubkey, &signers)
|
||||
}
|
||||
VoteInstruction::Vote(vote) => {
|
||||
datapoint_debug!("vote-native", ("count", 1, i64));
|
||||
inc_new_counter_info!("vote-native", 1);
|
||||
vote_state::process_vote(
|
||||
me,
|
||||
&SlotHashes::from_keyed_account(next_keyed_account(keyed_accounts)?)?,
|
||||
|
|
|
@ -446,7 +446,7 @@ impl Bank {
|
|||
rewards: None,
|
||||
};
|
||||
|
||||
datapoint_debug!(
|
||||
datapoint_info!(
|
||||
"bank-new_from_parent-heights",
|
||||
("slot_height", slot, i64),
|
||||
("block_height", new.block_height, i64)
|
||||
|
|
Loading…
Reference in New Issue