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: u8Stable schema discriminator, currently 4.
timestamp: StringUTC 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: usizeOuter file / deferred-retry attempt number (1 = first pass).
chunk_index: usizeChunk index within the file (1-based, matching the progress reports).
chunk_address: StringHex-encoded chunk address.
sweep: Stringinitial 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: Stringdirect, 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: boolExplicitly false so complete-response latency is never presented as
TTFB.
Why TTFB is unavailable.
bytes: u64Valid returned chunk bytes; 0 for non-found outcomes.
outcome: DownloadDiagnosticsOutcomeAttempt outcome. See DownloadDiagnosticsOutcome.
error: Option<String>Bounded diagnostic error category/detail; no secrets. None for
successful records.
Implementations§
Source§impl DownloadDiagnosticsRecord
impl DownloadDiagnosticsRecord
Sourcepub const TTFB_UNAVAILABLE_REASON: &'static str = "protocol exposes only a complete-response event; first-byte/first-frame \
timing is not available"
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.
Sourcepub 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"
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.
Sourcepub 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
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
impl Clone for DownloadDiagnosticsRecord
Source§fn clone(&self) -> DownloadDiagnosticsRecord
fn clone(&self) -> DownloadDiagnosticsRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DownloadDiagnosticsRecord
impl Debug for DownloadDiagnosticsRecord
impl Eq for DownloadDiagnosticsRecord
impl StructuralPartialEq for DownloadDiagnosticsRecord
Auto Trait Implementations§
impl Freeze for DownloadDiagnosticsRecord
impl RefUnwindSafe for DownloadDiagnosticsRecord
impl Send for DownloadDiagnosticsRecord
impl Sync for DownloadDiagnosticsRecord
impl Unpin for DownloadDiagnosticsRecord
impl UnsafeUnpin for DownloadDiagnosticsRecord
impl UnwindSafe for DownloadDiagnosticsRecord
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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