rm procinfo
This commit is contained in:
parent
ab24e9df77
commit
e706429b08
|
@ -222,7 +222,7 @@ dependencies = [
|
||||||
"asn1-rs-derive",
|
"asn1-rs-derive",
|
||||||
"asn1-rs-impl",
|
"asn1-rs-impl",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"nom 7.1.3",
|
"nom",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -1047,7 +1047,7 @@ checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asn1-rs",
|
"asn1-rs",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"nom 7.1.3",
|
"nom",
|
||||||
"num-bigint 0.4.3",
|
"num-bigint 0.4.3",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
|
@ -2208,7 +2208,6 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"postgres-native-tls",
|
"postgres-native-tls",
|
||||||
"procinfo",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_prometheus",
|
"serde_prometheus",
|
||||||
|
@ -2364,12 +2363,6 @@ dependencies = [
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nom"
|
|
||||||
version = "2.2.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.3"
|
version = "7.1.3"
|
||||||
|
@ -2900,18 +2893,6 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "procinfo"
|
|
||||||
version = "0.4.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6ab1427f3d2635891f842892dda177883dca0639e05fe66796a62c9d2f23b49c"
|
|
||||||
dependencies = [
|
|
||||||
"byteorder",
|
|
||||||
"libc",
|
|
||||||
"nom 2.2.1",
|
|
||||||
"rustc_version 0.2.3",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "qstring"
|
name = "qstring"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
|
@ -3225,6 +3206,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
|
<<<<<<< HEAD
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
|
@ -3243,11 +3225,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
|
=======
|
||||||
|
>>>>>>> 107e06a (rm procinfo)
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"semver 1.0.16",
|
"semver",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3256,7 +3240,7 @@ version = "4.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
|
checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom 7.1.3",
|
"nom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3394,6 +3378,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
|
<<<<<<< HEAD
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||||
|
@ -3412,11 +3397,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
|
=======
|
||||||
|
>>>>>>> 107e06a (rm procinfo)
|
||||||
version = "1.0.16"
|
version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
|
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
<<<<<<< HEAD
|
||||||
name = "semver-parser"
|
name = "semver-parser"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
@ -3432,6 +3420,8 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
=======
|
||||||
|
>>>>>>> 107e06a (rm procinfo)
|
||||||
name = "send_wrapper"
|
name = "send_wrapper"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
@ -3729,7 +3719,7 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"solana-frozen-abi 1.15.0",
|
"solana-frozen-abi 1.15.0",
|
||||||
"solana-frozen-abi-macro 1.15.0",
|
"solana-frozen-abi-macro 1.15.0",
|
||||||
|
@ -3740,6 +3730,97 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
name = "solana-clap-utils"
|
||||||
|
version = "1.14.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "36228e03e14bc7d7707189b66f625981993f1a000b0b192d5b42367349901d91"
|
||||||
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
|
"clap 2.34.0",
|
||||||
|
"rpassword",
|
||||||
|
"solana-perf",
|
||||||
|
"solana-remote-wallet",
|
||||||
|
"solana-sdk",
|
||||||
|
"thiserror",
|
||||||
|
"tiny-bip39",
|
||||||
|
"uriparse",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-cli-config"
|
||||||
|
version = "1.14.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6c43b08f24fd605eaeaafe0e834dc9b209137ac253bc874d32a5bdd791cbd318"
|
||||||
|
dependencies = [
|
||||||
|
"dirs-next",
|
||||||
|
"lazy_static",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"serde_yaml",
|
||||||
|
"solana-clap-utils",
|
||||||
|
"solana-sdk",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-client"
|
||||||
|
version = "1.14.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a3e270b1afd0b360c2aec42ae302ae7980ebb226017275b32a6156ab2ccbdad9"
|
||||||
|
dependencies = [
|
||||||
|
"async-mutex",
|
||||||
|
"async-trait",
|
||||||
|
"base64 0.13.1",
|
||||||
|
"bincode",
|
||||||
|
"bs58",
|
||||||
|
"bytes",
|
||||||
|
"clap 2.34.0",
|
||||||
|
"crossbeam-channel",
|
||||||
|
"enum_dispatch",
|
||||||
|
"futures",
|
||||||
|
"futures-util",
|
||||||
|
"indexmap",
|
||||||
|
"indicatif",
|
||||||
|
"itertools",
|
||||||
|
"jsonrpc-core",
|
||||||
|
"lazy_static",
|
||||||
|
"log",
|
||||||
|
"quinn",
|
||||||
|
"quinn-proto",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"rand_chacha 0.2.2",
|
||||||
|
"rayon",
|
||||||
|
"reqwest",
|
||||||
|
"rustls",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"serde_json",
|
||||||
|
"solana-account-decoder",
|
||||||
|
"solana-clap-utils",
|
||||||
|
"solana-faucet",
|
||||||
|
"solana-measure",
|
||||||
|
"solana-metrics",
|
||||||
|
"solana-net-utils",
|
||||||
|
"solana-sdk",
|
||||||
|
"solana-streamer",
|
||||||
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
|
"solana-vote-program",
|
||||||
|
"spl-token-2022",
|
||||||
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
|
"tokio-stream",
|
||||||
|
"tokio-tungstenite",
|
||||||
|
"tungstenite",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
>>>>>>> 107e06a (rm procinfo)
|
||||||
name = "solana-config-program"
|
name = "solana-config-program"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
@ -3774,7 +3855,7 @@ dependencies = [
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
@ -3825,7 +3906,7 @@ checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.50",
|
"proc-macro2 1.0.50",
|
||||||
"quote 1.0.23",
|
"quote 1.0.23",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"syn 1.0.107",
|
"syn 1.0.107",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3956,7 +4037,7 @@ dependencies = [
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.2.2",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
|
@ -4040,7 +4121,7 @@ dependencies = [
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"solana-frozen-abi 1.15.0",
|
"solana-frozen-abi 1.15.0",
|
||||||
"solana-frozen-abi-macro 1.15.0",
|
"solana-frozen-abi-macro 1.15.0",
|
||||||
|
@ -4117,6 +4198,7 @@ dependencies = [
|
||||||
"bs58",
|
"bs58",
|
||||||
"indicatif",
|
"indicatif",
|
||||||
"log",
|
"log",
|
||||||
|
<<<<<<< HEAD
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"semver 1.0.16",
|
"semver 1.0.16",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -4148,6 +4230,14 @@ dependencies = [
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
"solana-version",
|
"solana-version",
|
||||||
"spl-token-2022",
|
"spl-token-2022",
|
||||||
|
=======
|
||||||
|
"num-derive",
|
||||||
|
"num-traits",
|
||||||
|
"parking_lot",
|
||||||
|
"qstring",
|
||||||
|
"semver",
|
||||||
|
"solana-sdk",
|
||||||
|
>>>>>>> 107e06a (rm procinfo)
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -4184,7 +4274,7 @@ dependencies = [
|
||||||
"qstring",
|
"qstring",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.2.2",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
|
@ -4358,8 +4448,8 @@ name = "solana-version"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"semver 1.0.16",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"solana-frozen-abi 1.15.0",
|
"solana-frozen-abi 1.15.0",
|
||||||
|
@ -4375,7 +4465,7 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"solana-frozen-abi 1.15.0",
|
"solana-frozen-abi 1.15.0",
|
||||||
|
@ -5315,7 +5405,7 @@ dependencies = [
|
||||||
"data-encoding",
|
"data-encoding",
|
||||||
"der-parser",
|
"der-parser",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"nom 7.1.3",
|
"nom",
|
||||||
"oid-registry",
|
"oid-registry",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
|
@ -37,7 +37,6 @@ dashmap = "5.4.0"
|
||||||
const_env = "0.1.2"
|
const_env = "0.1.2"
|
||||||
jsonrpsee = { version = "0.16.2", features = ["macros", "full"] }
|
jsonrpsee = { version = "0.16.2", features = ["macros", "full"] }
|
||||||
tracing-subscriber = "0.3.16"
|
tracing-subscriber = "0.3.16"
|
||||||
procinfo = "0.4.2"
|
|
||||||
tokio-postgres = "0.7.7"
|
tokio-postgres = "0.7.7"
|
||||||
native-tls = "0.2.11"
|
native-tls = "0.2.11"
|
||||||
postgres-native-tls = "0.5.0"
|
postgres-native-tls = "0.5.0"
|
||||||
|
|
|
@ -124,6 +124,7 @@ impl LiteBridge {
|
||||||
|
|
||||||
let metrics_capture = MetricsCapture::new(self.tx_sender.clone());
|
let metrics_capture = MetricsCapture::new(self.tx_sender.clone());
|
||||||
let prometheus_sync = PrometheusSync::new(metrics_capture.clone()).sync();
|
let prometheus_sync = PrometheusSync::new(metrics_capture.clone()).sync();
|
||||||
|
let metrics_capture = metrics_capture.capture();
|
||||||
|
|
||||||
let finalized_block_listener = self
|
let finalized_block_listener = self
|
||||||
.finalized_block_listener
|
.finalized_block_listener
|
||||||
|
@ -176,7 +177,7 @@ impl LiteBridge {
|
||||||
tx_sender,
|
tx_sender,
|
||||||
finalized_block_listener,
|
finalized_block_listener,
|
||||||
confirmed_block_listener,
|
confirmed_block_listener,
|
||||||
metrics_capture.capture(postgres_send),
|
metrics_capture,
|
||||||
prometheus_sync,
|
prometheus_sync,
|
||||||
cleaner,
|
cleaner,
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use log::{info, warn};
|
use log::info;
|
||||||
use solana_transaction_status::TransactionConfirmationStatus;
|
use solana_transaction_status::TransactionConfirmationStatus;
|
||||||
use tokio::{sync::RwLock, task::JoinHandle};
|
use tokio::{sync::RwLock, task::JoinHandle};
|
||||||
|
|
||||||
use super::{PostgresMpscSend, TxSender};
|
use super::TxSender;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Background worker which captures metrics
|
/// Background worker which captures metrics
|
||||||
|
@ -22,7 +22,6 @@ pub struct Metrics {
|
||||||
pub txs_ps: usize,
|
pub txs_ps: usize,
|
||||||
pub txs_confirmed_ps: usize,
|
pub txs_confirmed_ps: usize,
|
||||||
pub txs_finalized_ps: usize,
|
pub txs_finalized_ps: usize,
|
||||||
pub mem_used: Option<usize>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MetricsCapture {
|
impl MetricsCapture {
|
||||||
|
@ -37,7 +36,7 @@ impl MetricsCapture {
|
||||||
self.metrics.read().await.to_owned()
|
self.metrics.read().await.to_owned()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn capture(self, postgres: Option<PostgresMpscSend>) -> JoinHandle<anyhow::Result<()>> {
|
pub fn capture(self) -> JoinHandle<anyhow::Result<()>> {
|
||||||
let mut one_second = tokio::time::interval(std::time::Duration::from_secs(1));
|
let mut one_second = tokio::time::interval(std::time::Duration::from_secs(1));
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
@ -76,18 +75,6 @@ impl MetricsCapture {
|
||||||
metrics.txs_sent = txs_sent;
|
metrics.txs_sent = txs_sent;
|
||||||
metrics.txs_confirmed = txs_confirmed;
|
metrics.txs_confirmed = txs_confirmed;
|
||||||
metrics.txs_finalized = txs_finalized;
|
metrics.txs_finalized = txs_finalized;
|
||||||
|
|
||||||
metrics.mem_used = match procinfo::pid::statm_self() {
|
|
||||||
Ok(statm) => Some(statm.size),
|
|
||||||
Err(err) => {
|
|
||||||
warn!("Error capturing memory consumption {err}");
|
|
||||||
None
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(_postgres) = &postgres {
|
|
||||||
// postgres.send_metrics(metrics.clone()).await?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue