mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat(metrics): configurable jeprof pprof dumps directory (#20834)
This commit is contained in:
@@ -31,6 +31,10 @@ pub struct DatadirArgs {
|
||||
/// The absolute path to store `RocksDB` database in.
|
||||
#[arg(long = "datadir.rocksdb", value_name = "PATH", verbatim_doc_comment)]
|
||||
pub rocksdb_path: Option<PathBuf>,
|
||||
|
||||
/// The absolute path to store pprof dumps in.
|
||||
#[arg(long = "datadir.pprof-dumps", value_name = "PATH", verbatim_doc_comment)]
|
||||
pub pprof_dumps_path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl DatadirArgs {
|
||||
|
||||
@@ -313,6 +313,18 @@ impl<D> ChainPath<D> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the path to the directory for storing pprof dumps for this chain.
|
||||
///
|
||||
/// `<DIR>/<CHAIN_ID>/pprof`
|
||||
pub fn pprof_dumps(&self) -> PathBuf {
|
||||
let datadir_args = &self.2;
|
||||
if let Some(pprof_dumps_path) = &datadir_args.pprof_dumps_path {
|
||||
pprof_dumps_path.clone()
|
||||
} else {
|
||||
self.data_dir().join("pprof")
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the path to the reth p2p secret key for this chain.
|
||||
///
|
||||
/// `<DIR>/<CHAIN_ID>/discovery-secret`
|
||||
|
||||
Reference in New Issue
Block a user