Skip to main content

DownloadDiagnosticsRecord

Struct DownloadDiagnosticsRecord 

Source
pub struct DownloadDiagnosticsRecord {
Show 34 fields pub schema_version: u8, pub timestamp: String, pub request_started_unix_ms: Option<u64>, pub request_completed_unix_ms: Option<u64>, pub request_id: Option<u64>, pub local_peer_id: Option<String>, pub file_attempt: usize, pub chunk_index: usize, pub chunk_address: String, pub sweep: String, pub peer_attempt: Option<usize>, pub lookup_duration_ms: Option<u64>, pub lookup_correlation_id: Option<String>, pub selected_peer_ordinal: Option<usize>, pub expected_peer: Option<String>, pub selected_peer_addresses: Option<Vec<String>>, pub selected_peer_address_types: Option<Vec<String>>, pub local_last_seen_age_ms: Option<u64>, pub publisher_address_set_age_ms: Option<u64>, pub publisher_address_set_unix_ns: Option<u64>, pub source_peer: Option<String>, pub transport_source: Option<String>, pub route: String, pub route_note: Option<String>, pub peer_connected_before_request: Option<bool>, pub active_requests_at_start: Option<usize>, pub fetch_cap: Option<usize>, pub response_elapsed_ms: Option<u64>, pub ttfb_ms: Option<u64>, pub ttfb_available: bool, pub ttfb_unavailable_reason: String, pub bytes: u64, pub outcome: DownloadDiagnosticsOutcome, pub error: Option<String>,
}
Expand description

One JSONL record for a normal-path chunk fetch attempt.

Field names are stable and pinned by the serialization tests. null JSON values are used for fields that do not apply to a given record kind (e.g. peer_attempt / expected_peer / source_peer / lookup_duration_ms are null for a cache hit, which has no peer).

Fields§

§schema_version: u8

Stable schema discriminator, currently 4.

§timestamp: String

UTC time the attempt completed, RFC 3339 (YYYY-MM-DDTHH:MM:SSZ).

§request_started_unix_ms: Option<u64>

Wall-clock Unix time immediately before the peer request, in milliseconds. Together with request_completed_unix_ms, this permits request overlap to be reconstructed against fleet telemetry.

§request_completed_unix_ms: Option<u64>

Wall-clock Unix time immediately after the peer request completed, in milliseconds. None for chunk-level records.

§request_id: Option<u64>

Protocol request identifier allocated by this client and sent on the wire; the serving node’s record for this GET carries the same value. None for chunk-level records where no peer request was sent.

§local_peer_id: Option<String>

This diagnostic client’s local peer ID, matching the serving node’s source_peer field. None for chunk-level records.

§file_attempt: usize

Outer file / deferred-retry attempt number (1 = first pass).

§chunk_index: usize

Chunk index within the file (1-based, matching the progress reports).

§chunk_address: String

Hex-encoded chunk address.

§sweep: String

initial or retry (internal close-group retry sweep).

§peer_attempt: Option<usize>

Peer attempt number within the sweep; None for chunk-level records (cache_hit, lookup_error, exhausted).

§lookup_duration_ms: Option<u64>

Closest-peer DHT lookup duration, emitted on the first peer attempt associated with that lookup; None otherwise.

§lookup_correlation_id: Option<String>

Process-local identifier shared by attempts from one closest-peer lookup.

§selected_peer_ordinal: Option<usize>

One-based ordinal in the DHT-selected peer order.

§expected_peer: Option<String>

Peer selected by the DHT lookup for this attempt; None for chunk-level records.

§selected_peer_addresses: Option<Vec<String>>

Dial addresses selected from the DHT record, in priority order.

§selected_peer_address_types: Option<Vec<String>>

Address-type labels parallel to selected_peer_addresses.

§local_last_seen_age_ms: Option<u64>

This client’s monotonic last-successful-DHT-interaction age. This is local knowledge, not proof of remote uptime.

§publisher_address_set_age_ms: Option<u64>

Publisher-clock-derived address-set age. The timestamp is untrusted and is not proof of remote uptime.

§publisher_address_set_unix_ns: Option<u64>

Raw publisher wall-clock address-set sequence, when present.

§source_peer: Option<String>

Authenticated peer that supplied the matching response, from the ChunkProtocolResponse metadata; None when no response was received (timeout / send failure) or for chunk-level records.

§transport_source: Option<String>

Transport address that delivered the response, from the ChunkProtocolResponse metadata; None when no response was received or for chunk-level records.

§route: String

direct, relay, lan, unverified, or unknown, classified from the actual transport source via P2PNode::classify_peer_transport_route. unknown for chunk-level records with no peer.

§route_note: Option<String>

Why route is unknown when that is the case; None once a real transport source is classified, and for chunk-level records.

§peer_connected_before_request: Option<bool>

Whether node.is_peer_connected(peer) returned true when sampled before the send; None for chunk-level records.

§active_requests_at_start: Option<usize>

Number of diagnostics-enabled peer requests active in this process immediately after this request entered the active set.

§fetch_cap: Option<usize>

Adaptive fetch concurrency cap snapshot at the time of this record; None when diagnostics are disabled (never emitted in that case).

§response_elapsed_ms: Option<u64>

Elapsed time until the complete response was reassembled and delivered; None for chunk-level records with no peer attempt.

§ttfb_ms: Option<u64>

Time to first byte. Always null — see ttfb_unavailable_reason.

§ttfb_available: bool

Explicitly false so complete-response latency is never presented as TTFB.

§ttfb_unavailable_reason: String

Why TTFB is unavailable.

§bytes: u64

Valid returned chunk bytes; 0 for non-found outcomes.

§outcome: DownloadDiagnosticsOutcome

Attempt outcome. See DownloadDiagnosticsOutcome.

§error: Option<String>

Bounded diagnostic error category/detail; no secrets. None for successful records.

Implementations§

Source§

impl DownloadDiagnosticsRecord

Source

pub const TTFB_UNAVAILABLE_REASON: &'static str = "protocol exposes only a complete-response event; first-byte/first-frame \ timing is not available"

The shared TTFB-unavailable reason string used by every record.

Source

pub const ROUTE_UNKNOWN_NOTE: &'static str = "transport_source absent or did not match any known typed peer dial address; \ route could not be classified from the observed response"

The shared route-unknown note used when classify_peer_transport_route returns Unknown: the transport source was absent (no response) or did not match any known typed peer dial address.

Source

pub fn chunk_level( file_attempt: usize, chunk_index: usize, chunk_address: &[u8; 32], sweep: &'static str, fetch_cap: Option<usize>, bytes: u64, outcome: DownloadDiagnosticsOutcome, error: Option<String>, ) -> Self

Build a chunk-level record (no peer attempt): cache hit, lookup error, or exhausted peer set.

Trait Implementations§

Source§

impl Clone for DownloadDiagnosticsRecord

Source§

fn clone(&self) -> DownloadDiagnosticsRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DownloadDiagnosticsRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DownloadDiagnosticsRecord

Source§

impl PartialEq for DownloadDiagnosticsRecord

Source§

fn eq(&self, other: &DownloadDiagnosticsRecord) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DownloadDiagnosticsRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DownloadDiagnosticsRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RpcSend for T
where T: Serialize + Clone + Debug + Send + Sync + Unpin,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more