Move metrics into its own crate
This commit is contained in:
@ -81,7 +81,6 @@ env_logger = "0.5.12"
|
|||||||
generic-array = { version = "0.12.0", default-features = false, features = ["serde"] }
|
generic-array = { version = "0.12.0", default-features = false, features = ["serde"] }
|
||||||
getopts = "0.2"
|
getopts = "0.2"
|
||||||
hex-literal = "0.1.1"
|
hex-literal = "0.1.1"
|
||||||
influx_db_client = "0.3.6"
|
|
||||||
solana-jsonrpc-core = "0.3.0"
|
solana-jsonrpc-core = "0.3.0"
|
||||||
solana-jsonrpc-http-server = "0.3.0"
|
solana-jsonrpc-http-server = "0.3.0"
|
||||||
solana-jsonrpc-macros = "0.3.0"
|
solana-jsonrpc-macros = "0.3.0"
|
||||||
@ -94,6 +93,7 @@ libc = "0.2.43"
|
|||||||
libloading = "0.5.0"
|
libloading = "0.5.0"
|
||||||
log = "0.4.2"
|
log = "0.4.2"
|
||||||
matches = "0.1.6"
|
matches = "0.1.6"
|
||||||
|
solana-metrics = { path = "metrics", version = "0.11.0" }
|
||||||
nix = "0.11.0"
|
nix = "0.11.0"
|
||||||
pnet_datalink = "0.21.0"
|
pnet_datalink = "0.21.0"
|
||||||
rand = "0.5.1"
|
rand = "0.5.1"
|
||||||
@ -112,7 +112,6 @@ sys-info = "0.5.6"
|
|||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
tokio-codec = "0.1"
|
tokio-codec = "0.1"
|
||||||
untrusted = "0.6.2"
|
untrusted = "0.6.2"
|
||||||
lazy_static = "1.2.0"
|
|
||||||
solana-bpfloader = { path = "programs/native/bpf_loader", version = "0.11.0" }
|
solana-bpfloader = { path = "programs/native/bpf_loader", version = "0.11.0" }
|
||||||
solana-erc20 = { path = "programs/native/erc20", version = "0.11.0" }
|
solana-erc20 = { path = "programs/native/erc20", version = "0.11.0" }
|
||||||
solana-lualoader = { path = "programs/native/lua_loader", version = "0.11.0" }
|
solana-lualoader = { path = "programs/native/lua_loader", version = "0.11.0" }
|
||||||
@ -140,6 +139,7 @@ name = "chacha"
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
".",
|
".",
|
||||||
|
"metrics",
|
||||||
"sdk",
|
"sdk",
|
||||||
"programs/bpf/rust/noop",
|
"programs/bpf/rust/noop",
|
||||||
"programs/native/bpf_loader",
|
"programs/native/bpf_loader",
|
||||||
|
@ -19,7 +19,7 @@ if [[ -n $CI ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
|
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
|
||||||
for Cargo_toml in {sdk,programs/native/{bpf_loader,lua_loader,noop},.}/Cargo.toml; do
|
for Cargo_toml in {sdk,metrics,programs/native/{bpf_loader,lua_loader,noop},.}/Cargo.toml; do
|
||||||
# TODO: Ensure the published version matches the contents of BUILDKITE_TAG
|
# TODO: Ensure the published version matches the contents of BUILDKITE_TAG
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
|
21
metrics/Cargo.toml
Normal file
21
metrics/Cargo.toml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
name = "solana-metrics"
|
||||||
|
version = "0.11.0"
|
||||||
|
description = "Solana Metrics"
|
||||||
|
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||||
|
repository = "https://github.com/solana-labs/solana"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
influx_db_client = "0.3.6"
|
||||||
|
log = "0.4.2"
|
||||||
|
rand = "0.5.1"
|
||||||
|
reqwest = "0.9.0"
|
||||||
|
lazy_static = "1.2.0"
|
||||||
|
solana-sdk = { path = "../sdk", version = "0.11.0" }
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "solana_metrics"
|
||||||
|
# crate-type = ["lib", "cdylib"]
|
||||||
|
|
||||||
|
|
16
metrics/src/lib.rs
Normal file
16
metrics/src/lib.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
pub extern crate influx_db_client;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate lazy_static;
|
||||||
|
extern crate rand;
|
||||||
|
extern crate reqwest;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate log;
|
||||||
|
extern crate solana_sdk;
|
||||||
|
|
||||||
|
mod metrics;
|
||||||
|
pub use metrics::flush;
|
||||||
|
pub use metrics::query;
|
||||||
|
pub use metrics::set_panic_hook;
|
||||||
|
pub use metrics::submit;
|
||||||
|
|
||||||
|
pub use influx_db_client as influxdb;
|
@ -4,12 +4,12 @@ extern crate reqwest;
|
|||||||
|
|
||||||
use influx_db_client as influxdb;
|
use influx_db_client as influxdb;
|
||||||
use rand;
|
use rand;
|
||||||
|
use solana_sdk::timing;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender};
|
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender};
|
||||||
use std::sync::{Arc, Barrier, Mutex, Once, ONCE_INIT};
|
use std::sync::{Arc, Barrier, Mutex, Once, ONCE_INIT};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use timing;
|
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref HOST_ID: i64 = rand::random::<i64>();
|
static ref HOST_ID: i64 = rand::random::<i64>();
|
@ -2,6 +2,7 @@ pub mod account;
|
|||||||
pub mod loader_instruction;
|
pub mod loader_instruction;
|
||||||
pub mod native_program;
|
pub mod native_program;
|
||||||
pub mod pubkey;
|
pub mod pubkey;
|
||||||
|
pub mod timing;
|
||||||
|
|
||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
extern crate bs58;
|
extern crate bs58;
|
||||||
|
@ -26,6 +26,7 @@ use signature::Keypair;
|
|||||||
use signature::Signature;
|
use signature::Signature;
|
||||||
use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount};
|
use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::{duration_as_us, timestamp};
|
||||||
use std;
|
use std;
|
||||||
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
|
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
|
||||||
use std::result;
|
use std::result;
|
||||||
@ -35,7 +36,6 @@ use std::time::Instant;
|
|||||||
use storage_program::StorageProgram;
|
use storage_program::StorageProgram;
|
||||||
use system_program::{Error, SystemProgram};
|
use system_program::{Error, SystemProgram};
|
||||||
use system_transaction::SystemTransaction;
|
use system_transaction::SystemTransaction;
|
||||||
use timing::{duration_as_us, timestamp};
|
|
||||||
use token_program;
|
use token_program;
|
||||||
use tokio::prelude::Future;
|
use tokio::prelude::Future;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
@ -15,6 +15,7 @@ use poh_service::{Config, PohService};
|
|||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use sigverify_stage::VerifiedPackets;
|
use sigverify_stage::VerifiedPackets;
|
||||||
|
use solana_sdk::timing;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError};
|
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError};
|
||||||
@ -22,7 +23,6 @@ use std::sync::{Arc, Mutex};
|
|||||||
use std::thread::{self, Builder, JoinHandle};
|
use std::thread::{self, Builder, JoinHandle};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use timing;
|
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate clap;
|
extern crate clap;
|
||||||
extern crate influx_db_client;
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
extern crate rayon;
|
extern crate rayon;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@ -9,9 +8,11 @@ extern crate log;
|
|||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
extern crate solana_metrics;
|
||||||
|
extern crate solana_sdk;
|
||||||
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use solana::client::mk_client;
|
use solana::client::mk_client;
|
||||||
@ -19,16 +20,16 @@ use solana::cluster_info::{ClusterInfo, NodeInfo};
|
|||||||
use solana::drone::{request_airdrop_transaction, DRONE_PORT};
|
use solana::drone::{request_airdrop_transaction, DRONE_PORT};
|
||||||
use solana::hash::Hash;
|
use solana::hash::Hash;
|
||||||
use solana::logger;
|
use solana::logger;
|
||||||
use solana::metrics;
|
|
||||||
use solana::ncp::Ncp;
|
use solana::ncp::Ncp;
|
||||||
use solana::service::Service;
|
use solana::service::Service;
|
||||||
use solana::signature::{read_keypair, GenKeys, Keypair, KeypairUtil};
|
use solana::signature::{read_keypair, GenKeys, Keypair, KeypairUtil};
|
||||||
use solana::system_transaction::SystemTransaction;
|
use solana::system_transaction::SystemTransaction;
|
||||||
use solana::thin_client::{poll_gossip_for_leader, ThinClient};
|
use solana::thin_client::{poll_gossip_for_leader, ThinClient};
|
||||||
use solana::timing::timestamp;
|
|
||||||
use solana::timing::{duration_as_ms, duration_as_s};
|
|
||||||
use solana::transaction::Transaction;
|
use solana::transaction::Transaction;
|
||||||
use solana::window::default_window;
|
use solana::window::default_window;
|
||||||
|
use solana_metrics::influxdb;
|
||||||
|
use solana_sdk::timing::timestamp;
|
||||||
|
use solana_sdk::timing::{duration_as_ms, duration_as_s};
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
@ -47,7 +48,7 @@ pub struct NodeStats {
|
|||||||
|
|
||||||
fn metrics_submit_token_balance(token_balance: u64) {
|
fn metrics_submit_token_balance(token_balance: u64) {
|
||||||
println!("Token balance: {}", token_balance);
|
println!("Token balance: {}", token_balance);
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("bench-tps")
|
influxdb::Point::new("bench-tps")
|
||||||
.add_tag("op", influxdb::Value::String("token_balance".to_string()))
|
.add_tag("op", influxdb::Value::String("token_balance".to_string()))
|
||||||
.add_field("balance", influxdb::Value::Integer(token_balance as i64))
|
.add_field("balance", influxdb::Value::Integer(token_balance as i64))
|
||||||
@ -134,7 +135,7 @@ fn send_barrier_transaction(barrier_client: &mut ThinClient, last_id: &mut Hash,
|
|||||||
if confirmatiom.is_ok() {
|
if confirmatiom.is_ok() {
|
||||||
println!("barrier transaction confirmed in {}ms", duration_ms);
|
println!("barrier transaction confirmed in {}ms", duration_ms);
|
||||||
|
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("bench-tps")
|
influxdb::Point::new("bench-tps")
|
||||||
.add_tag(
|
.add_tag(
|
||||||
"op",
|
"op",
|
||||||
@ -218,7 +219,7 @@ fn generate_txs(
|
|||||||
duration_as_ms(&duration),
|
duration_as_ms(&duration),
|
||||||
last_id,
|
last_id,
|
||||||
);
|
);
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("bench-tps")
|
influxdb::Point::new("bench-tps")
|
||||||
.add_tag("op", influxdb::Value::String("generate_txs".to_string()))
|
.add_tag("op", influxdb::Value::String("generate_txs".to_string()))
|
||||||
.add_field(
|
.add_field(
|
||||||
@ -274,7 +275,7 @@ fn do_tx_transfers(
|
|||||||
duration_as_ms(&transfer_start.elapsed()),
|
duration_as_ms(&transfer_start.elapsed()),
|
||||||
tx_len as f32 / duration_as_s(&transfer_start.elapsed()),
|
tx_len as f32 / duration_as_s(&transfer_start.elapsed()),
|
||||||
);
|
);
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("bench-tps")
|
influxdb::Point::new("bench-tps")
|
||||||
.add_tag("op", influxdb::Value::String("do_tx_transfers".to_string()))
|
.add_tag("op", influxdb::Value::String("do_tx_transfers".to_string()))
|
||||||
.add_field(
|
.add_field(
|
||||||
@ -498,7 +499,7 @@ fn should_switch_directions(num_tokens_per_account: u64, i: u64) -> bool {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
logger::setup();
|
logger::setup();
|
||||||
metrics::set_panic_hook("bench-tps");
|
solana_metrics::set_panic_hook("bench-tps");
|
||||||
|
|
||||||
let matches = App::new("solana-bench-tps")
|
let matches = App::new("solana-bench-tps")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
|
@ -6,6 +6,7 @@ extern crate clap;
|
|||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
extern crate solana_metrics;
|
||||||
extern crate tokio;
|
extern crate tokio;
|
||||||
extern crate tokio_codec;
|
extern crate tokio_codec;
|
||||||
|
|
||||||
@ -15,7 +16,6 @@ use bytes::Bytes;
|
|||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use solana::drone::{Drone, DroneRequest, DRONE_PORT};
|
use solana::drone::{Drone, DroneRequest, DRONE_PORT};
|
||||||
use solana::logger;
|
use solana::logger;
|
||||||
use solana::metrics::set_panic_hook;
|
|
||||||
use solana::signature::read_keypair;
|
use solana::signature::read_keypair;
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::io;
|
use std::io;
|
||||||
@ -38,7 +38,7 @@ macro_rules! socketaddr {
|
|||||||
|
|
||||||
fn main() -> Result<(), Box<error::Error>> {
|
fn main() -> Result<(), Box<error::Error>> {
|
||||||
logger::setup();
|
logger::setup();
|
||||||
set_panic_hook("drone");
|
solana_metrics::set_panic_hook("drone");
|
||||||
let matches = App::new("drone")
|
let matches = App::new("drone")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -6,6 +6,7 @@ extern crate log;
|
|||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
extern crate solana_metrics;
|
||||||
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use solana::client::mk_client;
|
use solana::client::mk_client;
|
||||||
@ -13,7 +14,6 @@ use solana::cluster_info::{Node, FULLNODE_PORT_RANGE};
|
|||||||
use solana::fullnode::{Config, Fullnode, FullnodeReturnType};
|
use solana::fullnode::{Config, Fullnode, FullnodeReturnType};
|
||||||
use solana::leader_scheduler::LeaderScheduler;
|
use solana::leader_scheduler::LeaderScheduler;
|
||||||
use solana::logger;
|
use solana::logger;
|
||||||
use solana::metrics::set_panic_hook;
|
|
||||||
use solana::netutil::find_available_port_in_range;
|
use solana::netutil::find_available_port_in_range;
|
||||||
use solana::signature::{Keypair, KeypairUtil};
|
use solana::signature::{Keypair, KeypairUtil};
|
||||||
use solana::thin_client::poll_gossip_for_leader;
|
use solana::thin_client::poll_gossip_for_leader;
|
||||||
@ -28,7 +28,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
logger::setup();
|
logger::setup();
|
||||||
set_panic_hook("fullnode");
|
solana_metrics::set_panic_hook("fullnode");
|
||||||
let matches = App::new("fullnode")
|
let matches = App::new("fullnode")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
extern crate influx_db_client;
|
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
use influx_db_client as influxdb;
|
extern crate solana_metrics;
|
||||||
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use solana::metrics;
|
use solana_metrics::influxdb;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
@ -16,7 +16,7 @@ fn get_last_metrics(metric: &str, db: &str, name: &str, branch: &str) -> Result<
|
|||||||
metric, db, name, branch
|
metric, db, name, branch
|
||||||
);
|
);
|
||||||
|
|
||||||
let response = metrics::query(&query)?;
|
let response = solana_metrics::query(&query)?;
|
||||||
|
|
||||||
match serde_json::from_str(&response) {
|
match serde_json::from_str(&response) {
|
||||||
Result::Ok(v) => {
|
Result::Ok(v) => {
|
||||||
@ -69,7 +69,7 @@ fn main() {
|
|||||||
let median = v["median"].to_string().parse().unwrap();
|
let median = v["median"].to_string().parse().unwrap();
|
||||||
let deviation = v["deviation"].to_string().parse().unwrap();
|
let deviation = v["deviation"].to_string().parse().unwrap();
|
||||||
if upload_metrics {
|
if upload_metrics {
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new(&v["name"].as_str().unwrap().trim_matches('\"'))
|
influxdb::Point::new(&v["name"].as_str().unwrap().trim_matches('\"'))
|
||||||
.add_tag("test", influxdb::Value::String("bench".to_string()))
|
.add_tag("test", influxdb::Value::String("bench".to_string()))
|
||||||
.add_tag("branch", influxdb::Value::String(branch.to_string()))
|
.add_tag("branch", influxdb::Value::String(branch.to_string()))
|
||||||
@ -112,5 +112,5 @@ fn main() {
|
|||||||
println!("{}, {}, {}", entry, values.0, values.1);
|
println!("{}, {}, {}", entry, values.0, values.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metrics::flush();
|
solana_metrics::flush();
|
||||||
}
|
}
|
||||||
|
@ -5,22 +5,22 @@ use counter::Counter;
|
|||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
#[cfg(feature = "erasure")]
|
#[cfg(feature = "erasure")]
|
||||||
use erasure;
|
use erasure;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use ledger::Block;
|
use ledger::Block;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
|
||||||
use packet::{index_blobs, SharedBlobs};
|
use packet::{index_blobs, SharedBlobs};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::duration_as_ms;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::{Receiver, RecvTimeoutError};
|
use std::sync::mpsc::{Receiver, RecvTimeoutError};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::thread::{self, Builder, JoinHandle};
|
use std::thread::{self, Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use timing::duration_as_ms;
|
|
||||||
use window::{SharedWindow, WindowIndex, WindowUtil};
|
use window::{SharedWindow, WindowIndex, WindowUtil};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
@ -162,7 +162,7 @@ fn broadcast(
|
|||||||
num_entries, to_blobs_elapsed, chunking_elapsed, broadcast_elapsed
|
num_entries, to_blobs_elapsed, chunking_elapsed, broadcast_elapsed
|
||||||
);
|
);
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("broadcast-stage")
|
influxdb::Point::new("broadcast-stage")
|
||||||
.add_field(
|
.add_field(
|
||||||
"transmit-index",
|
"transmit-index",
|
||||||
|
@ -30,6 +30,7 @@ use result::Result;
|
|||||||
use rpc::RPC_PORT;
|
use rpc::RPC_PORT;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::{duration_as_ms, timestamp};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
||||||
@ -38,7 +39,6 @@ use std::sync::{Arc, RwLock};
|
|||||||
use std::thread::{sleep, Builder, JoinHandle};
|
use std::thread::{sleep, Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use streamer::{BlobReceiver, BlobSender};
|
use streamer::{BlobReceiver, BlobSender};
|
||||||
use timing::{duration_as_ms, timestamp};
|
|
||||||
use window::{SharedWindow, WindowIndex};
|
use window::{SharedWindow, WindowIndex};
|
||||||
|
|
||||||
pub type NodeInfo = ContactInfo;
|
pub type NodeInfo = ContactInfo;
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
//! observed by the leader
|
//! observed by the leader
|
||||||
|
|
||||||
use bank::Bank;
|
use bank::Bank;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use metrics;
|
|
||||||
use service::Service;
|
use service::Service;
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
|
use solana_sdk::timing;
|
||||||
use std::result;
|
use std::result;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::thread::{self, Builder, JoinHandle};
|
use std::thread::{self, Builder, JoinHandle};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use timing;
|
|
||||||
use vote_program::VoteProgram;
|
use vote_program::VoteProgram;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
@ -72,7 +72,7 @@ impl ComputeLeaderFinalityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if last_valid_validator_timestamp != 0 {
|
if last_valid_validator_timestamp != 0 {
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new(&"leader-finality")
|
influxdb::Point::new(&"leader-finality")
|
||||||
.add_field(
|
.add_field(
|
||||||
"duration_ms",
|
"duration_ms",
|
||||||
@ -94,7 +94,7 @@ impl ComputeLeaderFinalityService {
|
|||||||
*last_valid_validator_timestamp = super_majority_timestamp;
|
*last_valid_validator_timestamp = super_majority_timestamp;
|
||||||
bank.set_finality((now - *last_valid_validator_timestamp) as usize);
|
bank.set_finality((now - *last_valid_validator_timestamp) as usize);
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new(&"leader-finality")
|
influxdb::Point::new(&"leader-finality")
|
||||||
.add_field("duration_ms", influxdb::Value::Integer(finality_ms as i64))
|
.add_field("duration_ms", influxdb::Value::Integer(finality_ms as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use rpc::RPC_PORT;
|
use rpc::RPC_PORT;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::timestamp;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||||
use timing::timestamp;
|
|
||||||
|
|
||||||
/// Structure representing a node on the network
|
/// Structure representing a node on the network
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
use influx_db_client as influxdb;
|
use solana_metrics::{influxdb, submit};
|
||||||
use metrics;
|
use solana_sdk::timing;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use timing;
|
|
||||||
|
|
||||||
const DEFAULT_LOG_RATE: usize = 1000;
|
const DEFAULT_LOG_RATE: usize = 1000;
|
||||||
|
|
||||||
@ -84,7 +83,7 @@ impl Counter {
|
|||||||
.lastlog
|
.lastlog
|
||||||
.compare_and_swap(lastlog, counts, Ordering::Relaxed);
|
.compare_and_swap(lastlog, counts, Ordering::Relaxed);
|
||||||
if prev == lastlog {
|
if prev == lastlog {
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new(&format!("counter-{}", self.name))
|
influxdb::Point::new(&format!("counter-{}", self.name))
|
||||||
.add_field(
|
.add_field(
|
||||||
"count",
|
"count",
|
||||||
|
@ -8,10 +8,11 @@ use bincode::{deserialize, serialize};
|
|||||||
use byteorder::{ByteOrder, LittleEndian};
|
use byteorder::{ByteOrder, LittleEndian};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use metrics;
|
|
||||||
use packet::PACKET_DATA_SIZE;
|
use packet::PACKET_DATA_SIZE;
|
||||||
use signature::Keypair;
|
use signature::Keypair;
|
||||||
|
use solana_metrics;
|
||||||
|
use solana_metrics::influxdb;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::{Error, ErrorKind};
|
use std::io::{Error, ErrorKind};
|
||||||
@ -112,7 +113,7 @@ impl Drone {
|
|||||||
} => {
|
} => {
|
||||||
if self.check_request_limit(tokens) {
|
if self.check_request_limit(tokens) {
|
||||||
self.request_current += tokens;
|
self.request_current += tokens;
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("drone")
|
influxdb::Point::new("drone")
|
||||||
.add_tag("op", influxdb::Value::String("airdrop".to_string()))
|
.add_tag("op", influxdb::Value::String("airdrop".to_string()))
|
||||||
.add_field("request_amount", influxdb::Value::Integer(tokens as i64))
|
.add_field("request_amount", influxdb::Value::Integer(tokens as i64))
|
||||||
@ -136,7 +137,7 @@ impl Drone {
|
|||||||
|
|
||||||
impl Drop for Drone {
|
impl Drop for Drone {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
metrics::flush();
|
solana_metrics::flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ use rpc::JsonRpcService;
|
|||||||
use rpc_pubsub::PubSubService;
|
use rpc_pubsub::PubSubService;
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_sdk::timing::timestamp;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::thread::Result;
|
use std::thread::Result;
|
||||||
use timing::timestamp;
|
|
||||||
use tpu::{Tpu, TpuReturnType};
|
use tpu::{Tpu, TpuReturnType};
|
||||||
use tvu::{Tvu, TvuReturnType};
|
use tvu::{Tvu, TvuReturnType};
|
||||||
use untrusted::Input;
|
use untrusted::Input;
|
||||||
|
@ -7,11 +7,11 @@ use ledger::LedgerWriter;
|
|||||||
use log::Level;
|
use log::Level;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
|
use solana_sdk::timing::duration_as_ms;
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::mpsc::{channel, RecvTimeoutError};
|
use std::sync::mpsc::{channel, RecvTimeoutError};
|
||||||
use std::thread::{self, Builder, JoinHandle};
|
use std::thread::{self, Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use timing::duration_as_ms;
|
|
||||||
|
|
||||||
pub struct LedgerWriteStage {
|
pub struct LedgerWriteStage {
|
||||||
write_thread: JoinHandle<()>,
|
write_thread: JoinHandle<()>,
|
||||||
|
@ -48,7 +48,6 @@ pub mod ledger;
|
|||||||
pub mod ledger_write_stage;
|
pub mod ledger_write_stage;
|
||||||
pub mod loader_transaction;
|
pub mod loader_transaction;
|
||||||
pub mod logger;
|
pub mod logger;
|
||||||
pub mod metrics;
|
|
||||||
pub mod mint;
|
pub mod mint;
|
||||||
pub mod native_loader;
|
pub mod native_loader;
|
||||||
pub mod ncp;
|
pub mod ncp;
|
||||||
@ -78,7 +77,6 @@ pub mod streamer;
|
|||||||
pub mod system_program;
|
pub mod system_program;
|
||||||
pub mod system_transaction;
|
pub mod system_transaction;
|
||||||
pub mod thin_client;
|
pub mod thin_client;
|
||||||
pub mod timing;
|
|
||||||
pub mod token_program;
|
pub mod token_program;
|
||||||
pub mod tpu;
|
pub mod tpu;
|
||||||
pub mod transaction;
|
pub mod transaction;
|
||||||
@ -130,17 +128,15 @@ extern crate solana_jsonrpc_http_server as jsonrpc_http_server;
|
|||||||
extern crate solana_jsonrpc_macros as jsonrpc_macros;
|
extern crate solana_jsonrpc_macros as jsonrpc_macros;
|
||||||
extern crate solana_jsonrpc_pubsub as jsonrpc_pubsub;
|
extern crate solana_jsonrpc_pubsub as jsonrpc_pubsub;
|
||||||
extern crate solana_jsonrpc_ws_server as jsonrpc_ws_server;
|
extern crate solana_jsonrpc_ws_server as jsonrpc_ws_server;
|
||||||
|
extern crate solana_metrics;
|
||||||
extern crate solana_sdk;
|
extern crate solana_sdk;
|
||||||
extern crate sys_info;
|
extern crate sys_info;
|
||||||
extern crate tokio;
|
extern crate tokio;
|
||||||
extern crate tokio_codec;
|
extern crate tokio_codec;
|
||||||
extern crate untrusted;
|
extern crate untrusted;
|
||||||
#[macro_use]
|
|
||||||
extern crate lazy_static;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate matches;
|
extern crate matches;
|
||||||
|
|
||||||
extern crate influx_db_client;
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
@ -5,14 +5,15 @@ use cluster_info::ClusterInfo;
|
|||||||
use counter::Counter;
|
use counter::Counter;
|
||||||
use entry::{EntryReceiver, EntrySender};
|
use entry::{EntryReceiver, EntrySender};
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use ledger::Block;
|
use ledger::Block;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
|
||||||
use packet::BlobError;
|
use packet::BlobError;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
|
use solana_sdk::timing::duration_as_ms;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
@ -22,7 +23,6 @@ use std::thread::{self, Builder, JoinHandle};
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use streamer::{responder, BlobSender};
|
use streamer::{responder, BlobSender};
|
||||||
use timing::duration_as_ms;
|
|
||||||
use vote_stage::send_validator_vote;
|
use vote_stage::send_validator_vote;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
@ -73,7 +73,7 @@ impl ReplicateStage {
|
|||||||
entries.append(&mut more);
|
entries.append(&mut more);
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("replicate-stage")
|
influxdb::Point::new("replicate-stage")
|
||||||
.add_field("count", influxdb::Value::Integer(entries.len() as i64))
|
.add_field("count", influxdb::Value::Integer(entries.len() as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
use cluster_info::ClusterInfo;
|
use cluster_info::ClusterInfo;
|
||||||
use counter::Counter;
|
use counter::Counter;
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use leader_scheduler::LeaderScheduler;
|
use leader_scheduler::LeaderScheduler;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize};
|
use std::sync::atomic::{AtomicBool, AtomicUsize};
|
||||||
use std::sync::mpsc::RecvTimeoutError;
|
use std::sync::mpsc::RecvTimeoutError;
|
||||||
@ -31,7 +31,7 @@ fn retransmit(
|
|||||||
dq.append(&mut nq);
|
dq.append(&mut nq);
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("retransmit-stage")
|
influxdb::Point::new("retransmit-stage")
|
||||||
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -6,21 +6,21 @@
|
|||||||
//! if the `cuda` feature is enabled with `--features=cuda`.
|
//! if the `cuda` feature is enabled with `--features=cuda`.
|
||||||
|
|
||||||
use counter::Counter;
|
use counter::Counter;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
|
||||||
use packet::SharedPackets;
|
use packet::SharedPackets;
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use sigverify;
|
use sigverify;
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
|
use solana_sdk::timing;
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender};
|
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::thread::{self, spawn, JoinHandle};
|
use std::thread::{self, spawn, JoinHandle};
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use streamer::{self, PacketReceiver};
|
use streamer::{self, PacketReceiver};
|
||||||
use timing;
|
|
||||||
|
|
||||||
pub type VerifiedPackets = Vec<(SharedPackets, Vec<u8>)>;
|
pub type VerifiedPackets = Vec<(SharedPackets, Vec<u8>)>;
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ impl SigVerifyStage {
|
|||||||
(len as f32 / total_time_s)
|
(len as f32 / total_time_s)
|
||||||
);
|
);
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("sigverify_stage-total_verify_time")
|
influxdb::Point::new("sigverify_stage-total_verify_time")
|
||||||
.add_field("batch_len", influxdb::Value::Integer(batch_len as i64))
|
.add_field("batch_len", influxdb::Value::Integer(batch_len as i64))
|
||||||
.add_field("len", influxdb::Value::Integer(len as i64))
|
.add_field("len", influxdb::Value::Integer(len as i64))
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
//! The `streamer` module defines a set of services for efficiently pulling data from UDP sockets.
|
//! The `streamer` module defines a set of services for efficiently pulling data from UDP sockets.
|
||||||
//!
|
//!
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use metrics;
|
|
||||||
use packet::{Blob, SharedBlobs, SharedPackets};
|
use packet::{Blob, SharedBlobs, SharedPackets};
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
|
use solana_sdk::timing::duration_as_ms;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc::{Receiver, RecvTimeoutError, Sender};
|
use std::sync::mpsc::{Receiver, RecvTimeoutError, Sender};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread::{Builder, JoinHandle};
|
use std::thread::{Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use timing::duration_as_ms;
|
|
||||||
|
|
||||||
pub type PacketReceiver = Receiver<SharedPackets>;
|
pub type PacketReceiver = Receiver<SharedPackets>;
|
||||||
pub type PacketSender = Sender<SharedPackets>;
|
pub type PacketSender = Sender<SharedPackets>;
|
||||||
@ -33,7 +33,7 @@ fn recv_loop(
|
|||||||
}
|
}
|
||||||
if msgs.write().unwrap().recv_from(sock).is_ok() {
|
if msgs.write().unwrap().recv_from(sock).is_ok() {
|
||||||
let len = msgs.read().unwrap().packets.len();
|
let len = msgs.read().unwrap().packets.len();
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new(channel_tag)
|
influxdb::Point::new(channel_tag)
|
||||||
.add_field("count", influxdb::Value::Integer(len as i64))
|
.add_field("count", influxdb::Value::Integer(len as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -15,8 +15,11 @@ use result::{Error, Result};
|
|||||||
use rpc_request::RpcRequest;
|
use rpc_request::RpcRequest;
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use signature::{Keypair, Signature};
|
use signature::{Keypair, Signature};
|
||||||
|
use solana_metrics;
|
||||||
|
use solana_metrics::influxdb;
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
@ -27,12 +30,8 @@ use std::thread::sleep;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use system_transaction::SystemTransaction;
|
use system_transaction::SystemTransaction;
|
||||||
use timing;
|
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use metrics;
|
|
||||||
|
|
||||||
/// An object for querying and sending transactions to the network.
|
/// An object for querying and sending transactions to the network.
|
||||||
pub struct ThinClient {
|
pub struct ThinClient {
|
||||||
rpc_addr: SocketAddr,
|
rpc_addr: SocketAddr,
|
||||||
@ -109,7 +108,7 @@ impl ThinClient {
|
|||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
let tx = Transaction::system_new(keypair, to, n, *last_id);
|
let tx = Transaction::system_new(keypair, to, n, *last_id);
|
||||||
let result = self.transfer_signed(&tx);
|
let result = self.transfer_signed(&tx);
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("thinclient")
|
influxdb::Point::new("thinclient")
|
||||||
.add_tag("op", influxdb::Value::String("transfer".to_string()))
|
.add_tag("op", influxdb::Value::String("transfer".to_string()))
|
||||||
.add_field(
|
.add_field(
|
||||||
@ -226,7 +225,7 @@ impl ThinClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn submit_poll_balance_metrics(elapsed: &Duration) {
|
pub fn submit_poll_balance_metrics(elapsed: &Duration) {
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("thinclient")
|
influxdb::Point::new("thinclient")
|
||||||
.add_tag("op", influxdb::Value::String("get_balance".to_string()))
|
.add_tag("op", influxdb::Value::String("get_balance".to_string()))
|
||||||
.add_field(
|
.add_field(
|
||||||
@ -302,7 +301,7 @@ impl ThinClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("thinclient")
|
influxdb::Point::new("thinclient")
|
||||||
.add_tag("op", influxdb::Value::String("check_signature".to_string()))
|
.add_tag("op", influxdb::Value::String("check_signature".to_string()))
|
||||||
.add_field(
|
.add_field(
|
||||||
@ -316,7 +315,7 @@ impl ThinClient {
|
|||||||
|
|
||||||
impl Drop for ThinClient {
|
impl Drop for ThinClient {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
metrics::flush();
|
solana_metrics::flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,14 +3,15 @@
|
|||||||
use cluster_info::{ClusterInfo, NodeInfo};
|
use cluster_info::{ClusterInfo, NodeInfo};
|
||||||
use counter::Counter;
|
use counter::Counter;
|
||||||
use entry::EntrySender;
|
use entry::EntrySender;
|
||||||
use influx_db_client as influxdb;
|
|
||||||
use leader_scheduler::LeaderScheduler;
|
use leader_scheduler::LeaderScheduler;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
|
||||||
use packet::SharedBlob;
|
use packet::SharedBlob;
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
|
use solana_metrics::{influxdb, submit};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::duration_as_ms;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::RecvTimeoutError;
|
use std::sync::mpsc::RecvTimeoutError;
|
||||||
@ -18,7 +19,6 @@ use std::sync::{Arc, RwLock};
|
|||||||
use std::thread::{Builder, JoinHandle};
|
use std::thread::{Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use streamer::{BlobReceiver, BlobSender};
|
use streamer::{BlobReceiver, BlobSender};
|
||||||
use timing::duration_as_ms;
|
|
||||||
use window::{SharedWindow, WindowUtil};
|
use window::{SharedWindow, WindowUtil};
|
||||||
|
|
||||||
pub const MAX_REPAIR_BACKOFF: usize = 128;
|
pub const MAX_REPAIR_BACKOFF: usize = 128;
|
||||||
@ -115,7 +115,7 @@ fn retransmit_all_leader_blocks(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("retransmit-queue")
|
influxdb::Point::new("retransmit-queue")
|
||||||
.add_field(
|
.add_field(
|
||||||
"count",
|
"count",
|
||||||
@ -168,7 +168,7 @@ fn recv_window(
|
|||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
inc_new_counter_info!("streamer-recv_window-recv", dq.len(), 100);
|
inc_new_counter_info!("streamer-recv_window-recv", dq.len(), 100);
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("recv-window")
|
influxdb::Point::new("recv-window")
|
||||||
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
@ -306,7 +306,7 @@ pub fn window_service(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics::submit(
|
submit(
|
||||||
influxdb::Point::new("window-stage")
|
influxdb::Point::new("window-stage")
|
||||||
.add_field("consumed", influxdb::Value::Integer(consumed as i64))
|
.add_field("consumed", influxdb::Value::Integer(consumed as i64))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate rayon;
|
extern crate rayon;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
extern crate solana_sdk;
|
||||||
|
|
||||||
use rayon::iter::*;
|
use rayon::iter::*;
|
||||||
use solana::cluster_info::{ClusterInfo, Node};
|
use solana::cluster_info::{ClusterInfo, Node};
|
||||||
@ -10,7 +11,7 @@ use solana::ncp::Ncp;
|
|||||||
use solana::packet::{Blob, SharedBlob};
|
use solana::packet::{Blob, SharedBlob};
|
||||||
use solana::result;
|
use solana::result;
|
||||||
use solana::service::Service;
|
use solana::service::Service;
|
||||||
use solana::timing::timestamp;
|
use solana_sdk::timing::timestamp;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
@ -26,10 +26,10 @@ use solana::service::Service;
|
|||||||
use solana::signature::{Keypair, KeypairUtil};
|
use solana::signature::{Keypair, KeypairUtil};
|
||||||
use solana::system_transaction::SystemTransaction;
|
use solana::system_transaction::SystemTransaction;
|
||||||
use solana::thin_client::{retry_get_balance, ThinClient};
|
use solana::thin_client::{retry_get_balance, ThinClient};
|
||||||
use solana::timing::{duration_as_ms, duration_as_s};
|
|
||||||
use solana::transaction::Transaction;
|
use solana::transaction::Transaction;
|
||||||
use solana::window::default_window;
|
use solana::window::default_window;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
use solana_sdk::timing::{duration_as_ms, duration_as_s};
|
||||||
use std::collections::{HashSet, VecDeque};
|
use std::collections::{HashSet, VecDeque};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::{copy, create_dir_all, remove_dir_all};
|
use std::fs::{copy, create_dir_all, remove_dir_all};
|
||||||
|
Reference in New Issue
Block a user