#[non_exhaustive]pub enum CachegrindMetrics {
Default,
CacheMisses,
CacheMissRates,
CacheHits,
CacheHitRates,
CacheSim,
BranchSim,
All,
None,
SingleEvent(CachegrindMetric),
}api only.Expand description
A collection of groups of CachegrindMetrics
The members of each group are fully documented in the docs of each variant of this enum
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default
The default group contains all metrics except the CachegrindMetrics::CacheMisses,
CachegrindMetrics::CacheMissRates, CachegrindMetrics::CacheHitRates and
EventKind::Dr, EventKind::Dw. More specifically, the following event kinds and
groups in this order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::Ir.into(),
CachegrindMetrics::CacheHits,
CachegrindMetric::TotalRW.into(),
CachegrindMetric::EstimatedCycles.into(),
CachegrindMetrics::BranchSim,
];CacheMisses
The CacheMisses produced by --cache-sim=yes contain the following CachegrindMetrics
in this order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::I1mr.into(),
CachegrindMetric::D1mr.into(),
CachegrindMetric::D1mw.into(),
CachegrindMetric::ILmr.into(),
CachegrindMetric::DLmr.into(),
CachegrindMetric::DLmw.into(),
];CacheMissRates
The cache miss rates calculated from the CallgrindMetrics::CacheMisses produced by
--cache-sim:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::I1MissRate.into(),
CachegrindMetric::LLiMissRate.into(),
CachegrindMetric::D1MissRate.into(),
CachegrindMetric::LLdMissRate.into(),
CachegrindMetric::LLMissRate.into(),
];CacheHits
CacheHits are iai-callgrind specific and calculated from the metrics produced by
--cache-sim=yes in this order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::L1hits.into(),
CachegrindMetric::LLhits.into(),
CachegrindMetric::RamHits.into(),
];CacheHitRates
The cache hit rates calculated from the CachegrindMetrics::CacheHits:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::L1HitRate.into(),
CachegrindMetric::LLHitRate.into(),
CachegrindMetric::RamHitRate.into(),
];CacheSim
All metrics produced by --cache-sim=yes including the iai-callgrind specific metrics
CachegrindMetric::L1hits, CachegrindMetric::LLhits, CachegrindMetric::RamHits,
CachegrindMetric::TotalRW, CachegrindMetric::EstimatedCycles,
CachegrindMetrics::CacheMissRates and CachegrindMetrics::CacheHitRates in this
order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::Dr.into(),
CachegrindMetric::Dw.into(),
CachegrindMetrics::CacheMisses,
CachegrindMetrics::CacheMissRates,
CachegrindMetrics::CacheHits,
CachegrindMetrics::CacheHitRates,
CachegrindMetric::TotalRW.into(),
CachegrindMetric::EstimatedCycles.into(),
];BranchSim
The metrics produced by --branch-sim=yes in this order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::Bc.into(),
CachegrindMetric::Bcm.into(),
CachegrindMetric::Bi.into(),
CachegrindMetric::Bim.into(),
];All
All possible CachegrindMetrics in this order:
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
let metrics: Vec<CachegrindMetrics> = vec![
CachegrindMetric::Ir.into(),
CachegrindMetrics::CacheSim,
CachegrindMetrics::BranchSim,
];None
Selection of no CachegrindMetric at all
SingleEvent(CachegrindMetric)
Specify a single CachegrindMetric.
Note that CachegrindMetric implements the necessary traits to convert to the
CachegrindMetrics::SingleEvent variant.
§Examples
use iai_callgrind::{CachegrindMetric, CachegrindMetrics};
assert_eq!(
CachegrindMetrics::SingleEvent(CachegrindMetric::Ir),
CachegrindMetric::Ir.into()
);Trait Implementations§
Source§impl Clone for CachegrindMetrics
impl Clone for CachegrindMetrics
Source§fn clone(&self) -> CachegrindMetrics
fn clone(&self) -> CachegrindMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CachegrindMetrics
impl Debug for CachegrindMetrics
Source§impl Default for CachegrindMetrics
impl Default for CachegrindMetrics
Source§fn default() -> CachegrindMetrics
fn default() -> CachegrindMetrics
Source§impl<'de> Deserialize<'de> for CachegrindMetrics
impl<'de> Deserialize<'de> for CachegrindMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CachegrindMetric> for CachegrindMetrics
impl From<CachegrindMetric> for CachegrindMetrics
Source§fn from(value: CachegrindMetric) -> Self
fn from(value: CachegrindMetric) -> Self
Source§impl From<CachegrindMetrics> for IndexSet<CachegrindMetric>
Available on crate feature runner only.
impl From<CachegrindMetrics> for IndexSet<CachegrindMetric>
runner only.Source§fn from(value: CachegrindMetrics) -> Self
fn from(value: CachegrindMetrics) -> Self
Source§impl FromStr for CachegrindMetrics
Available on crate feature runner only.
impl FromStr for CachegrindMetrics
runner only.Source§impl PartialEq for CachegrindMetrics
impl PartialEq for CachegrindMetrics
Source§impl Serialize for CachegrindMetrics
impl Serialize for CachegrindMetrics
impl Copy for CachegrindMetrics
impl StructuralPartialEq for CachegrindMetrics
Auto Trait Implementations§
impl Freeze for CachegrindMetrics
impl RefUnwindSafe for CachegrindMetrics
impl Send for CachegrindMetrics
impl Sync for CachegrindMetrics
impl Unpin for CachegrindMetrics
impl UnwindSafe for CachegrindMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more