pub struct LogEvent {
pub ts: String,
pub kind: String,
pub ms: u64,
pub stages: BTreeMap<String, u64>,
pub candidates: Option<usize>,
pub folded: Option<usize>,
pub rerank_docs: Option<usize>,
pub rerank_tokens: Option<usize>,
pub hits: Option<usize>,
pub documents: Option<usize>,
pub format: Option<String>,
pub degraded: Vec<Degrade>,
}Expand description
一条事件。kind 决定哪些字段有值,无值的字段不出现。
事件里不含查询原文与正文:宿主本来就知道查询词,库再抄一遍只是把检索词 散进宿主的日志文件。
Fields§
§ts: String本地时间的 RFC3339 时间戳,毫秒精度。
kind: String事件类型:search、index_rebuild。
ms: u64本次执行的总耗时(毫秒)。
stages: BTreeMap<String, u64>各阶段耗时(毫秒)。rerank 是「等宿主重排回调返回」的时间,也就是模型
推理时间,不是库的开销;embed 同理。
candidates: Option<usize>参与融合的候选条数。
folded: Option<usize>折叠后剩下的条数。
rerank_docs: Option<usize>实际送进重排回调的文档数。
rerank_tokens: Option<usize>实际送进重排回调的文档 token 数(含查询词)。
hits: Option<usize>最终返回的命中条数。
documents: Option<usize>重建写入索引的文档数。
format: Option<String>索引格式串。
degraded: Vec<Degrade>本次落在哪几档降级。
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogEvent
impl<'de> Deserialize<'de> for LogEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LogEvent
impl RefUnwindSafe for LogEvent
impl Send for LogEvent
impl Sync for LogEvent
impl Unpin for LogEvent
impl UnsafeUnpin for LogEvent
impl UnwindSafe for LogEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> ⓘ
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 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> ⓘ
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