pub struct ExecutionLogTelemetry { /* private fields */ }Expand description
将执行日志与 Telemetry 桥接的实现。
实现 Telemetry trait,
将事件生命周期事件记录到 ExecutionLog 中。
§Example
ⓘ
use anycms_event::prelude::*;
use anycms_event::execution_log::{ExecutionLog, ExecutionLogTelemetry};
let log = ExecutionLog::in_memory();
let telemetry = ExecutionLogTelemetry::new(log);
let bus = EventBus::builder()
.telemetry(telemetry)
.build();Implementations§
Source§impl ExecutionLogTelemetry
impl ExecutionLogTelemetry
Sourcepub fn new(log: ExecutionLog) -> Self
pub fn new(log: ExecutionLog) -> Self
创建新的执行日志遥测。
Trait Implementations§
Source§impl Telemetry for ExecutionLogTelemetry
impl Telemetry for ExecutionLogTelemetry
Source§fn on_publish(&self, event_name: &str, receivers: usize)
fn on_publish(&self, event_name: &str, receivers: usize)
事件发布时调用。
Source§fn on_publish_complete(&self, _event_name: &str, _elapsed: Duration)
fn on_publish_complete(&self, _event_name: &str, _elapsed: Duration)
事件发布完成后调用。
Source§fn on_subscribe(&self, _event_name: &str, _sub_id: usize)
fn on_subscribe(&self, _event_name: &str, _sub_id: usize)
订阅者注册时调用。
Source§fn on_handler_start(&self, _event_name: &str, _sub_id: usize)
fn on_handler_start(&self, _event_name: &str, _sub_id: usize)
Handler 执行前调用。
Auto Trait Implementations§
impl !Freeze for ExecutionLogTelemetry
impl !RefUnwindSafe for ExecutionLogTelemetry
impl !UnwindSafe for ExecutionLogTelemetry
impl Send for ExecutionLogTelemetry
impl Sync for ExecutionLogTelemetry
impl Unpin for ExecutionLogTelemetry
impl UnsafeUnpin for ExecutionLogTelemetry
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