pub struct Profiler { /* private fields */ }Expand description
Profiles rows one at a time in bounded memory. See the module docs.
use rich_data::profile::{ProfileOptions, Profiler};
use rich_data::Value;
let options = ProfileOptions { sample: 100, ..Default::default() };
let mut profiler = Profiler::new(&["n".to_string()], options).unwrap();
for n in 0..10_000 {
profiler.push(vec![Value::Int(n)]);
}
let profile = profiler.finish();
assert_eq!((profile.rows(), profile.sample_size()), (10_000, 100));
assert!(profile.sampled());
assert!(profile.heading().starts_with("sampled 100 of 10,000 rows"));Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn new(
columns: &[String],
options: ProfileOptions,
) -> Result<Self, DataError>
pub fn new( columns: &[String], options: ProfileOptions, ) -> Result<Self, DataError>
A profiler for rows with columns. Fails when
ProfileOptions::columns names a column there is not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnsafeUnpin for Profiler
impl UnwindSafe for Profiler
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more