hotpath-meta 0.15.1

Hotpath meta - a version of hotpath used to profile the profiler itself. Not intended for external use.
Documentation
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AllocMetric {
    Bytes,
    Count,
}

pub(crate) fn alloc_metric() -> AllocMetric {
    match std::env::var("HOTPATH_META_ALLOC_METRIC") {
        Ok(v) => match v.to_lowercase().as_str() {
            "bytes" => AllocMetric::Bytes,
            "count" => AllocMetric::Count,
            other => panic!(
                "Invalid HOTPATH_META_ALLOC_METRIC value: '{}'. Expected 'bytes' or 'count'.",
                other
            ),
        },
        Err(_) => AllocMetric::Bytes,
    }
}

#[inline]
pub(crate) fn is_alloc_cumulative_enabled() -> bool {
    std::env::var("HOTPATH_META_ALLOC_CUMULATIVE")
        .map(|v| v.eq_ignore_ascii_case("true") || v == "1")
        .unwrap_or(false)
}