Merge pull request #44 from blockworks-foundation/rm_proc_info
Rm proc info
This commit is contained in:
commit
2cc7d9709e
|
@ -134,7 +134,7 @@ dependencies = [
|
|||
"asn1-rs-derive",
|
||||
"asn1-rs-impl",
|
||||
"displaydoc",
|
||||
"nom 7.1.3",
|
||||
"nom",
|
||||
"num-traits",
|
||||
"rusticata-macros",
|
||||
"thiserror",
|
||||
|
@ -926,7 +926,7 @@ checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1"
|
|||
dependencies = [
|
||||
"asn1-rs",
|
||||
"displaydoc",
|
||||
"nom 7.1.3",
|
||||
"nom",
|
||||
"num-bigint 0.4.3",
|
||||
"num-traits",
|
||||
"rusticata-macros",
|
||||
|
@ -2110,7 +2110,6 @@ dependencies = [
|
|||
"log",
|
||||
"native-tls",
|
||||
"postgres-native-tls",
|
||||
"procinfo",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_prometheus",
|
||||
|
@ -2260,12 +2259,6 @@ dependencies = [
|
|||
"memoffset 0.6.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "2.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
|
@ -2768,18 +2761,6 @@ dependencies = [
|
|||
"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]]
|
||||
name = "qstring"
|
||||
version = "0.7.2"
|
||||
|
@ -3100,22 +3081,13 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||
dependencies = [
|
||||
"semver 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||
dependencies = [
|
||||
"semver 1.0.16",
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3124,7 +3096,7 @@ version = "4.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
|
||||
dependencies = [
|
||||
"nom 7.1.3",
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3249,27 +3221,12 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
dependencies = [
|
||||
"semver-parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
|
||||
|
||||
[[package]]
|
||||
name = "semver-parser"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
|
||||
[[package]]
|
||||
name = "send_wrapper"
|
||||
version = "0.4.0"
|
||||
|
@ -3569,7 +3526,7 @@ dependencies = [
|
|||
"log",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"serde",
|
||||
"solana-frozen-abi",
|
||||
"solana-frozen-abi-macro",
|
||||
|
@ -3643,7 +3600,7 @@ dependencies = [
|
|||
"rayon",
|
||||
"reqwest",
|
||||
"rustls",
|
||||
"semver 1.0.16",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
|
@ -3728,7 +3685,7 @@ dependencies = [
|
|||
"memmap2",
|
||||
"once_cell",
|
||||
"rand_core 0.6.4",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_derive",
|
||||
|
@ -3747,7 +3704,7 @@ checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62"
|
|||
dependencies = [
|
||||
"proc-macro2 1.0.50",
|
||||
"quote 1.0.23",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"syn 1.0.107",
|
||||
]
|
||||
|
||||
|
@ -3867,7 +3824,7 @@ dependencies = [
|
|||
"parking_lot",
|
||||
"rand 0.7.3",
|
||||
"rand_chacha 0.2.2",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"rustversion",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
|
@ -3901,7 +3858,7 @@ dependencies = [
|
|||
"num-derive",
|
||||
"num-traits",
|
||||
"rand 0.7.3",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"serde",
|
||||
"solana-frozen-abi",
|
||||
"solana-frozen-abi-macro",
|
||||
|
@ -3934,7 +3891,7 @@ dependencies = [
|
|||
"num-traits",
|
||||
"parking_lot",
|
||||
"qstring",
|
||||
"semver 1.0.16",
|
||||
"semver",
|
||||
"solana-sdk",
|
||||
"thiserror",
|
||||
"uriparse",
|
||||
|
@ -3973,7 +3930,7 @@ dependencies = [
|
|||
"qstring",
|
||||
"rand 0.7.3",
|
||||
"rand_chacha 0.2.2",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"rustversion",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
|
@ -4069,8 +4026,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "5a46c9ecb15ccd5388511cec0c5bfb989589425f8286ce432ff64b55dc7bf61e"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rustc_version 0.4.0",
|
||||
"semver 1.0.16",
|
||||
"rustc_version",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"solana-frozen-abi",
|
||||
|
@ -4088,7 +4045,7 @@ dependencies = [
|
|||
"log",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"rustc_version 0.4.0",
|
||||
"rustc_version",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"solana-frozen-abi",
|
||||
|
@ -5008,7 +4965,7 @@ dependencies = [
|
|||
"data-encoding",
|
||||
"der-parser",
|
||||
"lazy_static",
|
||||
"nom 7.1.3",
|
||||
"nom",
|
||||
"oid-registry",
|
||||
"rusticata-macros",
|
||||
"thiserror",
|
||||
|
|
|
@ -33,7 +33,6 @@ dashmap = "5.4.0"
|
|||
const_env = "0.1.2"
|
||||
jsonrpsee = { version = "0.16.2", features = ["macros", "full"] }
|
||||
tracing-subscriber = "0.3.16"
|
||||
procinfo = "0.4.2"
|
||||
tokio-postgres = "0.7.7"
|
||||
native-tls = "0.2.11"
|
||||
postgres-native-tls = "0.5.0"
|
||||
|
|
|
@ -124,6 +124,7 @@ impl LiteBridge {
|
|||
|
||||
let metrics_capture = MetricsCapture::new(self.tx_sender.clone());
|
||||
let prometheus_sync = PrometheusSync::new(metrics_capture.clone()).sync();
|
||||
let metrics_capture = metrics_capture.capture();
|
||||
|
||||
let finalized_block_listener = self
|
||||
.finalized_block_listener
|
||||
|
@ -176,7 +177,7 @@ impl LiteBridge {
|
|||
tx_sender,
|
||||
finalized_block_listener,
|
||||
confirmed_block_listener,
|
||||
metrics_capture.capture(postgres_send),
|
||||
metrics_capture,
|
||||
prometheus_sync,
|
||||
cleaner,
|
||||
];
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use log::{info, warn};
|
||||
use log::info;
|
||||
use solana_transaction_status::TransactionConfirmationStatus;
|
||||
use tokio::{sync::RwLock, task::JoinHandle};
|
||||
|
||||
use super::{PostgresMpscSend, TxSender};
|
||||
use super::TxSender;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Background worker which captures metrics
|
||||
|
@ -22,7 +22,6 @@ pub struct Metrics {
|
|||
pub txs_ps: usize,
|
||||
pub txs_confirmed_ps: usize,
|
||||
pub txs_finalized_ps: usize,
|
||||
pub mem_used: Option<usize>,
|
||||
}
|
||||
|
||||
impl MetricsCapture {
|
||||
|
@ -37,7 +36,7 @@ impl MetricsCapture {
|
|||
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));
|
||||
|
||||
tokio::spawn(async move {
|
||||
|
@ -76,18 +75,6 @@ impl MetricsCapture {
|
|||
metrics.txs_sent = txs_sent;
|
||||
metrics.txs_confirmed = txs_confirmed;
|
||||
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