add new ods logging for bookmark fetching from phases crate

Summary:
add new ods logging for bookmark fetching from phases crate

This would help with investigation sevs like S344849, also having this info we
can setup alerts.

Reviewed By: YousefSalama

Differential Revision: D46314640

fbshipit-source-id: 66e72da19ad4eb528c78d0783c297746f57cd4f1
This commit is contained in:
Liubov Dmitrieva 2023-05-31 13:57:24 -07:00 committed by Facebook GitHub Bot
parent 88e493047e
commit 45565b3045

View File

@ -30,10 +30,17 @@ use sql::mysql_async::prelude::ConvIr;
use sql::mysql_async::prelude::FromValue;
use sql::mysql_async::FromValueError;
use sql::mysql_async::Value;
use stats::define_stats;
use stats::prelude::*;
use crate::errors::SqlPhasesError;
use crate::sql_store::SqlPhasesStore;
define_stats! {
prefix = "mononoke.phases";
public_heads_fetched: timeseries(Rate, Sum),
}
/// Newtype wrapper for Phase that allows us to derive SQL conversions.
#[derive(Abomonation, Clone, Copy, PartialEq, Eq, Debug)]
#[derive(mysql::OptTryFromRowField)]
@ -170,6 +177,8 @@ impl SqlPhases {
return Ok(public_cold);
}
// log fetching public heads
STATS::public_heads_fetched.add_value(1);
let heads = (self.heads_fetcher)(ctx).await?;
let freshly_marked = mark_reachable_as_public(ctx, self, &heads, ephemeral_derive).await?;