Add a logging_timer macro to te criterion next methods

This commit is contained in:
Clément Renault 2021-03-06 11:28:22 +01:00 committed by Kerollmops
parent 82a0f678fb
commit b18ec00a7a
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 113 additions and 49 deletions

View file

@ -146,6 +146,7 @@ impl<'t> AscDesc<'t> {
}
impl<'t> Criterion for AscDesc<'t> {
#[logging_timer::time("AscDesc::{}")]
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>> {
loop {
debug!("Facet {}({}) iteration",

View file

@ -48,6 +48,7 @@ impl<'t> Fetcher<'t> {
}
impl<'t> Criterion for Fetcher<'t> {
#[logging_timer::time("Fetcher::{}")]
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>> {
use Candidates::{Allowed, Forbidden};
loop {

View file

@ -56,6 +56,7 @@ impl<'t> Proximity<'t> {
}
impl<'t> Criterion for Proximity<'t> {
#[logging_timer::time("Proximity::{}")]
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>> {
use Candidates::{Allowed, Forbidden};
loop {

View file

@ -53,6 +53,7 @@ impl<'t> Typo<'t> {
}
impl<'t> Criterion for Typo<'t> {
#[logging_timer::time("Typo::{}")]
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>> {
use Candidates::{Allowed, Forbidden};
loop {

View file

@ -47,6 +47,7 @@ impl<'t> Words<'t> {
}
impl<'t> Criterion for Words<'t> {
#[logging_timer::time("Words::{}")]
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>> {
use Candidates::{Allowed, Forbidden};
loop {