pub struct JournalTallies {}Expand description
The journal’s counters since start: how much it holds, how much it has written,
received, absorbed, refused, held back and compacted away. They are what makes a
replication problem diagnosable from one machine — a runtime whose received never
rises is not linked, one whose rejected rises is being sent something it will not
take, and one whose pending stays high is missing an event ahead of what it has.
use std::sync::Arc;
use majordomus_cli::mesh::identity::NodeIdentity;
use majordomus_cli::mesh::journal::{EventBody, Journal, JournalTallies};
let j = Journal::open(Arc::new(NodeIdentity::ephemeral().unwrap()), "0000000000000001",
"repo".into(), None).unwrap();
let before: JournalTallies = j.tallies();
assert_eq!((before.written, before.events), (0, 0));
j.append_own(EventBody::SessionClosed { session: "s1".into() }).unwrap();
let after = j.tallies();
assert_eq!((after.written, after.events, after.streams), (1, 1, 1));
assert!(after.lamport > before.lamport);Fields§
§streams: usizeStreams tracked.
events: usizeEvents held.
written: u64Events written by this runtime since start.
received: u64Events received and stored.
duplicates: u64Duplicate deliveries absorbed.
rejected: u64Events refused.
pending: usizeEvents held for a gap right now.
compacted: u64Events dropped by compaction since start.
opaque: usizeEvents of a kind this executable does not interpret, held and relayed.
lamport: u64The highest Lamport stamp seen.
write_failures: u64Appends to the journal file that failed since start: the events were held in memory
and replicated, and are not on this machine’s disk. Nonzero fails mesh doctor.
unreadable: u64Lines of the journal file the last reload could not read: torn, corrupt, or written by something that is not this journal. Counted, never silently dropped.
unread_bytes: u64Bytes of the journal file the last reload left unread because they lie beyond
MAX_RELOAD_BYTES: on disk and kept by compaction, and not in memory. Nonzero fails
mesh doctor.
Trait Implementations§
Source§impl Clone for JournalTallies
impl Clone for JournalTallies
Source§fn clone(&self) -> JournalTallies
fn clone(&self) -> JournalTallies
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for JournalTallies
Source§impl Debug for JournalTallies
impl Debug for JournalTallies
Source§impl Default for JournalTallies
impl Default for JournalTallies
Source§fn default() -> JournalTallies
fn default() -> JournalTallies
Source§impl<'de> Deserialize<'de> for JournalTallies
impl<'de> Deserialize<'de> for JournalTallies
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>,
impl Eq for JournalTallies
Source§impl JsonSchema for JournalTallies
impl JsonSchema for JournalTallies
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for JournalTallies
impl PartialEq for JournalTallies
Source§fn eq(&self, other: &JournalTallies) -> bool
fn eq(&self, other: &JournalTallies) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for JournalTallies
impl Serialize for JournalTallies
impl StructuralPartialEq for JournalTallies
Auto Trait Implementations§
impl Freeze for JournalTallies
impl RefUnwindSafe for JournalTallies
impl Send for JournalTallies
impl Sync for JournalTallies
impl Unpin for JournalTallies
impl UnsafeUnpin for JournalTallies
impl UnwindSafe for JournalTallies
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.