pub struct InMemoryLedger { /* private fields */ }Expand description
A CostLedger that keeps every record in memory, oldest first.
Process-local — one isolate’s view on Workers — which suits a
measurement window and is not a billing system.
Implementations§
Source§impl InMemoryLedger
impl InMemoryLedger
Sourcepub fn records(&self) -> Vec<CallRecord>
pub fn records(&self) -> Vec<CallRecord>
Every record so far, oldest first.
Sourcepub fn totals(&self) -> BTreeMap<AdapterId, LedgerTotals>
pub fn totals(&self) -> BTreeMap<AdapterId, LedgerTotals>
Totals per adapter.
Sourcepub fn role_totals(&self) -> BTreeMap<CallRole, LedgerTotals>
pub fn role_totals(&self) -> BTreeMap<CallRole, LedgerTotals>
Totals per CallRole: the Discarded row is what escalation
wasted, the Shadow row what measuring cost.
Trait Implementations§
Source§impl CostLedger for InMemoryLedger
impl CostLedger for InMemoryLedger
Source§fn record(&self, record: CallRecord)
fn record(&self, record: CallRecord)
Records one call. Must not block on I/O or fail.
Source§impl Debug for InMemoryLedger
impl Debug for InMemoryLedger
Auto Trait Implementations§
impl !Freeze for InMemoryLedger
impl RefUnwindSafe for InMemoryLedger
impl Send for InMemoryLedger
impl Sync for InMemoryLedger
impl Unpin for InMemoryLedger
impl UnsafeUnpin for InMemoryLedger
impl UnwindSafe for InMemoryLedger
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