Skip to content

Commit eb543db

Browse files
committed
Remove measure_allocs feature from main crate
1 parent 96e8967 commit eb543db

File tree

5 files changed

+1
-57
lines changed

5 files changed

+1
-57
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
## Breaking Changes
2525

26+
* The "measure_allocs" feature has been removed.
2627
* #1135 The "no_metrics" anti-feature has been replaced with
2728
the "metrics" positive feature.
2829
* #1178 the `Event` enum has become a unified struct that allows

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ event_log = []
3939
metrics = ["num-format"]
4040
no_logs = ["log/max_level_off"]
4141
no_inline = []
42-
measure_allocs = []
4342
pretty_backtrace = ["color-backtrace"]
4443
io_uring = ["rio"]
4544
docs = []

src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,6 @@ mod flusher;
243243
/// The event log helps debug concurrency issues.
244244
pub mod event_log;
245245

246-
#[cfg(feature = "measure_allocs")]
247-
mod measure_allocs;
248-
249-
#[cfg(feature = "measure_allocs")]
250-
#[global_allocator]
251-
static ALLOCATOR: measure_allocs::TrackingAllocator =
252-
measure_allocs::TrackingAllocator;
253-
254246
/// Opens a `Db` with a default configuration at the
255247
/// specified path. This will create a new storage
256248
/// directory at the specified path if it does

src/measure_allocs.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/metrics.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ pub struct Metrics {
145145
pub tree_traverse: Histogram,
146146
pub write_to_log: Histogram,
147147
pub written_bytes: Histogram,
148-
#[cfg(feature = "measure_allocs")]
149-
pub allocations: CachePadded<AtomicUsize>,
150-
#[cfg(feature = "measure_allocs")]
151-
pub allocated_bytes: CachePadded<AtomicUsize>,
152148
}
153149

154150
impl Metrics {
@@ -437,27 +433,6 @@ impl Metrics {
437433
sz("seg util end", &self.segment_utilization_shutdown),
438434
]));
439435

440-
#[cfg(feature = "measure_allocs")]
441-
{
442-
ret.push_str(&format!(
443-
"{}\n",
444-
std::iter::repeat("-").take(134).collect::<String>()
445-
));
446-
ret.push_str("allocation statistics:\n");
447-
ret.push_str(&format!(
448-
"total allocations: {}\n",
449-
measure_allocs::ALLOCATIONS
450-
.load(Acquire)
451-
.to_formatted_string(&Locale::en)
452-
));
453-
ret.push_str(&format!(
454-
"allocated bytes: {}\n",
455-
measure_allocs::ALLOCATED_BYTES
456-
.load(Acquire)
457-
.to_formatted_string(&Locale::en)
458-
));
459-
}
460-
461436
ret
462437
}
463438
}

0 commit comments

Comments
 (0)