Skip to content

Commit b9a90c2

Browse files
committed
changes
1 parent 781c3ed commit b9a90c2

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

opentelemetry-sdk/src/logs/growable_array.rs

-60
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ mod tests {
233233
use opentelemetry::logs::AnyValue;
234234
use opentelemetry::Key;
235235

236-
#[cfg(feature = "memory-profiling")]
237-
use crate::testing::global_allocator;
238-
239-
#[cfg(feature = "memory-profiling")]
240-
use jemalloc_ctl::{epoch, stats};
241-
242236
/// A struct to hold a key-value pair and implement `Default`.
243237
#[derive(Clone, Debug, PartialEq)]
244238
struct KeyValuePair(Key, AnyValue);
@@ -338,58 +332,4 @@ mod tests {
338332
collection.push(15);
339333
assert!(collection.contains(&15));
340334
}
341-
342-
#[cfg(feature = "memory-profiling")]
343-
#[test]
344-
fn test_memory_allocation_string() {
345-
// Reset jemalloc epoch to refresh stats
346-
let e = epoch::mib().unwrap();
347-
e.advance().unwrap();
348-
349-
// Get memory stats before the code block
350-
let allocated_before = stats::allocated::read().unwrap();
351-
352-
// Code block to measure: Allocate a large string
353-
let large_string: String = "a".repeat(100_000);
354-
355-
// Refresh jemalloc stats
356-
e.advance().unwrap();
357-
358-
// Get memory stats after the code block
359-
let allocated_after = stats::allocated::read().unwrap();
360-
361-
// Calculate the difference
362-
let allocated_diff = allocated_after - allocated_before;
363-
364-
// Assert or print the difference
365-
println!("Memory allocated for String: {} bytes", allocated_diff);
366-
assert!(allocated_diff > 0);
367-
}
368-
369-
#[cfg(feature = "memory-profiling")]
370-
#[test]
371-
fn test_memory_allocation_int() {
372-
// Reset jemalloc epoch to refresh stats
373-
let e = epoch::mib().unwrap();
374-
e.advance().unwrap();
375-
376-
// Get memory stats before the code block
377-
let allocated_before = stats::allocated::read().unwrap();
378-
379-
// Code block to measure: Allocate a vector of integers
380-
let vec: Vec<i32> = (0..100_000).collect();
381-
382-
// Refresh jemalloc stats
383-
e.advance().unwrap();
384-
385-
// Get memory stats after the code block
386-
let allocated_after = stats::allocated::read().unwrap();
387-
388-
// Calculate the difference
389-
let allocated_diff = allocated_after - allocated_before;
390-
391-
// Assert or print the difference
392-
println!("Memory allocated for Vec<i32>: {} bytes", allocated_diff);
393-
assert!(allocated_diff > 0);
394-
}
395335
}

0 commit comments

Comments
 (0)