pub struct N1Alert {
pub relation: String,
pub query_count: u64,
pub batch_count: u64,
pub threshold: u64,
}Expand description
N+1 查询告警
Fields§
§relation: String触发告警的 relation 名称
query_count: u64单条查询次数
batch_count: u64批量查询次数(0 表示完全没有使用批量加载)
threshold: u64配置的阈值
Implementations§
Source§impl N1Alert
impl N1Alert
Sourcepub fn no_batch_used(&self) -> bool
pub fn no_batch_used(&self) -> bool
是否完全未使用批量加载
Sourcepub fn suggested_batch_size(&self) -> usize
pub fn suggested_batch_size(&self) -> usize
建议的批量大小(query_count 向上取整到 10 的幂级,至少 50)
Trait Implementations§
impl Eq for N1Alert
impl StructuralPartialEq for N1Alert
Auto Trait Implementations§
impl Freeze for N1Alert
impl RefUnwindSafe for N1Alert
impl Send for N1Alert
impl Sync for N1Alert
impl Unpin for N1Alert
impl UnsafeUnpin for N1Alert
impl UnwindSafe for N1Alert
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,
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>
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