mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 17:41:01 +00:00
Introduce jemalloc-allocator feature flag (#6675)
* Introduce jemalloc-stats feature flag * remove unneeded space * Update node/overseer/src/lib.rs Co-authored-by: Marcin S. <marcin@bytedude.com> * Update Cargo.toml Co-authored-by: Marcin S. <marcin@bytedude.com> * revert making tikv-jemallocator depend on jemalloc-stats * conditionally import memory_stats instead of using dead_code * fix test via expllicit import * Add jemalloc-stats feature to crates, propagate it from root * Apply `jemalloc-stats` feature to prepare mem stats; small refactor * effect changes recommended on PR * Update node/overseer/src/metrics.rs Co-authored-by: Marcin S. <marcin@bytedude.com> * fix compile error on in pipeline for linux. missing import * Update node/overseer/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * revert to defining collect_memory_stats inline --------- Co-authored-by: Marcin S. <marcin@bytedude.com> Co-authored-by: Marcin S <marcin@realemail.net> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use tikv_jemalloc_ctl::{epoch, stats, Error};
|
||||
use tikv_jemalloc_ctl::stats;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MemoryAllocationTracker {
|
||||
@@ -24,15 +24,15 @@ pub struct MemoryAllocationTracker {
|
||||
}
|
||||
|
||||
impl MemoryAllocationTracker {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
pub fn new() -> Result<Self, tikv_jemalloc_ctl::Error> {
|
||||
Ok(Self {
|
||||
epoch: epoch::mib()?,
|
||||
epoch: tikv_jemalloc_ctl::epoch::mib()?,
|
||||
allocated: stats::allocated::mib()?,
|
||||
resident: stats::resident::mib()?,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn snapshot(&self) -> Result<MemoryAllocationSnapshot, Error> {
|
||||
pub fn snapshot(&self) -> Result<MemoryAllocationSnapshot, tikv_jemalloc_ctl::Error> {
|
||||
// update stats by advancing the allocation epoch
|
||||
self.epoch.advance()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user