Struct mz_ore::lgbytes::LgBytesOpMetrics
source · pub struct LgBytesOpMetrics {
heap: LgBytesRegionMetrics,
mmap: LgBytesRegionMetrics,
alloc_seconds: Counter,
mmap_disabled_count: IntCounter,
mmap_error_count: IntCounter,
len_sizes: Histogram,
}
Available on crate features
bytes_
and region
only.Expand description
Metrics for an individual usage of LgBytes.
Fields§
§heap: LgBytesRegionMetrics
§mmap: LgBytesRegionMetrics
§alloc_seconds: Counter
§mmap_disabled_count: IntCounter
§mmap_error_count: IntCounter
§len_sizes: Histogram
Implementations§
source§impl LgBytesOpMetrics
impl LgBytesOpMetrics
sourcepub fn new_region<T: Copy>(&self, capacity: usize) -> MetricsRegion<T>
pub fn new_region<T: Copy>(&self, capacity: usize) -> MetricsRegion<T>
Returns a new empty MetricsRegion
to hold at least T
elements.
sourcepub fn try_mmap<T: AsRef<[u8]>>(&self, buf: T) -> LgBytes
pub fn try_mmap<T: AsRef<[u8]>>(&self, buf: T) -> LgBytes
Attempts to copy the given buf into an lgalloc managed file-based mapped region, falling back to a heap allocation.
sourcepub fn try_mmap_region<T: Copy>(
&self,
buf: impl AsRef<[T]>,
) -> Result<MetricsRegion<T>, AllocError>
pub fn try_mmap_region<T: Copy>( &self, buf: impl AsRef<[T]>, ) -> Result<MetricsRegion<T>, AllocError>
Attempts to copy the given buf into an lgalloc managed file-based mapped region.
sourcepub fn heap_region<T: Copy>(&self, buf: Vec<T>) -> MetricsRegion<T>
pub fn heap_region<T: Copy>(&self, buf: Vec<T>) -> MetricsRegion<T>
Wraps the already owned buf into a Region::Heap with metrics.
Besides metrics, this is essentially a no-op.
fn metrics_region<T: Copy>(&self, buf: Region<T>) -> MetricsRegion<T>
Trait Implementations§
source§impl Clone for LgBytesOpMetrics
impl Clone for LgBytesOpMetrics
source§fn clone(&self) -> LgBytesOpMetrics
fn clone(&self) -> LgBytesOpMetrics
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LgBytesOpMetrics
impl RefUnwindSafe for LgBytesOpMetrics
impl Send for LgBytesOpMetrics
impl Sync for LgBytesOpMetrics
impl Unpin for LgBytesOpMetrics
impl UnwindSafe for LgBytesOpMetrics
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request