pub struct AnalyticsStreamConfig {
pub sink: AnalyticsStreamSink,
pub buffer: Option<u64>,
pub flush_ms: Option<u64>,
pub batch_max: Option<u64>,
}Expand description
Real-time access-record stream (DW-121,
gateway.analytics_stream).
Every completed request’s access record is copied onto a bounded channel at request completion (drop-and-count on full — the stream can never slow the dataplane), and a background flusher turns the queue into ordered batches delivered to the configured sink: one delivery per flushed BATCH, not per record. The channel capacity is fixed at boot; the sink set, flush cadence, and batch bound are read live from the current generation, so a reload can retarget or disable the stream without a restart.
Fields§
§sink: AnalyticsStreamSinkWhere flushed batches go. One sink in v1 (type: webhook); the
set is closed so a second implementation (a Kafka producer is
the documented slot) is an additive config change, not a silent
behavior change.
buffer: Option<u64>Capacity of the bounded record channel (default 8192; validated to [64, 65536]). The queue’s entire memory story: every queued record is an owned copy, and a full queue DROPS (and counts) rather than blocking the request path. Startup wiring: the capacity is fixed when the gateway boots (a live reload changes the sink and the cadence, not this).
flush_ms: Option<u64>Maximum batch latency in milliseconds (default 1000; validated
to [100, 60000]): a batch is flushed when it holds
batch_max records, reaches the batch byte cap, or this much
time has passed since its first record — whichever comes first.
Read live per flush cycle.
batch_max: Option<u64>Maximum records per flushed batch (default 512; validated to [1, 4096]). With the batch byte cap, whichever comes first. One batch is one delivery, so this is also the largest single delivery’s record count.
Trait Implementations§
Source§impl Clone for AnalyticsStreamConfig
impl Clone for AnalyticsStreamConfig
Source§fn clone(&self) -> AnalyticsStreamConfig
fn clone(&self) -> AnalyticsStreamConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnalyticsStreamConfig
impl Debug for AnalyticsStreamConfig
Source§impl<'de> Deserialize<'de> for AnalyticsStreamConfig
impl<'de> Deserialize<'de> for AnalyticsStreamConfig
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 JsonSchema for AnalyticsStreamConfig
impl JsonSchema for AnalyticsStreamConfig
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 AnalyticsStreamConfig
impl PartialEq for AnalyticsStreamConfig
Source§impl Serialize for AnalyticsStreamConfig
impl Serialize for AnalyticsStreamConfig
impl StructuralPartialEq for AnalyticsStreamConfig
Auto Trait Implementations§
impl Freeze for AnalyticsStreamConfig
impl RefUnwindSafe for AnalyticsStreamConfig
impl Send for AnalyticsStreamConfig
impl Sync for AnalyticsStreamConfig
impl Unpin for AnalyticsStreamConfig
impl UnwindSafe for AnalyticsStreamConfig
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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