mononoke: add counters for fetching disabled filenodes

Summary: Let's log to ods so that we can check what's hapenning with filenodes.

Reviewed By: ahornby

Differential Revision: D21904400

fbshipit-source-id: e602dfc338c02252cad286176a1965bdc7043d7f
This commit is contained in:
Stanislau Hlebik 2020-06-08 05:15:13 -07:00 committed by Facebook GitHub Bot
parent 14e4d561b3
commit 6f9e685a1a
2 changed files with 6 additions and 0 deletions

View File

@ -39,7 +39,9 @@ define_stats! {
prefix = "mononoke.filenodes";
gets: timeseries(Sum),
gets_master: timeseries(Sum),
gets_disabled: timeseries(Sum),
range_gets: timeseries(Sum),
range_gets_disabled: timeseries(Sum),
path_gets: timeseries(Sum),
get_local_cache_misses: timeseries(Sum),
range_local_cache_misses: timeseries(Sum),
@ -336,6 +338,7 @@ async fn select_filenode_from_sql(
recorder: &PerfCounterRecorder<'_>,
) -> Result<FilenodeResult<Option<CachedFilenode>>, ErrorKind> {
if tunables().get_filenodes_disabled() {
STATS::gets_disabled.add_value(1);
return Ok(FilenodeResult::Disabled);
}
@ -420,6 +423,7 @@ async fn select_history_from_sql(
recorder: &PerfCounterRecorder<'_>,
) -> Result<FilenodeResult<CachedHistory>, Error> {
if tunables().get_filenodes_disabled() {
STATS::range_gets_disabled.add_value(1);
return Ok(FilenodeResult::Disabled);
}

View File

@ -24,6 +24,7 @@ use futures::compat::Future01CompatExt;
define_stats! {
prefix = "mononoke.filenodes";
adds: timeseries(Rate, Sum, Count),
adds_disabled: timeseries(Rate, Sum, Count),
}
#[derive(Debug, Eq, DeriveError, PartialEq)]
@ -91,6 +92,7 @@ impl FilenodesWriter {
replace: bool,
) -> Result<FilenodeResult<()>, Error> {
if tunables().get_filenodes_disabled() {
STATS::adds_disabled.add_value(1);
return Ok(FilenodeResult::Disabled);
}