pub struct BatchSpanExporter { /* private fields */ }Expand description
批量 Span 导出器(内存模拟)。
收集 span 到队列,达到批次大小或导出间隔时批量导出。 实际实现中会通过 OTLP/HTTP 发送到 Collector。
Implementations§
Source§impl BatchSpanExporter
impl BatchSpanExporter
Sourcepub fn new(config: BatchConfig) -> Self
pub fn new(config: BatchConfig) -> Self
创建批量导出器
Sourcepub fn flush_batch(&self) -> usize
pub fn flush_batch(&self) -> usize
尝试导出一批 span。
当队列长度 >= max_batch_size 时导出整批,否则不导出。 返回导出的 span 数量。
Sourcepub fn exported_batch_count(&self) -> usize
pub fn exported_batch_count(&self) -> usize
获取已导出的批次数
Sourcepub fn exported_span_count(&self) -> usize
pub fn exported_span_count(&self) -> usize
获取已导出的 span 总数
Sourcepub fn dropped_count(&self) -> u64
pub fn dropped_count(&self) -> u64
获取被丢弃的 span 数量
Sourcepub fn config(&self) -> &BatchConfig
pub fn config(&self) -> &BatchConfig
获取配置引用
Auto Trait Implementations§
impl !Freeze for BatchSpanExporter
impl !RefUnwindSafe for BatchSpanExporter
impl !UnwindSafe for BatchSpanExporter
impl Send for BatchSpanExporter
impl Sync for BatchSpanExporter
impl Unpin for BatchSpanExporter
impl UnsafeUnpin for BatchSpanExporter
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