diff --git a/eden/mononoke/cmds/backfill_derived_data/main.rs b/eden/mononoke/cmds/backfill_derived_data/main.rs index d8f5a02834..988a81991f 100644 --- a/eden/mononoke/cmds/backfill_derived_data/main.rs +++ b/eden/mononoke/cmds/backfill_derived_data/main.rs @@ -57,7 +57,7 @@ use time_ext::DurationExt; use topo_sort::sort_topological; use tunables::tunables; -mod benchmark; +mod regenerate; mod slice; mod warmup; @@ -644,15 +644,15 @@ async fn run_subcmd<'a>( if sub_m.is_present(ARG_PARALLEL) { let batch_size = args::get_u64_opt(&sub_m, ARG_BATCH_SIZE); - benchmark::BenchmarkOptions::BackfillParallel { batch_size } + regenerate::DeriveOptions::BackfillParallel { batch_size } } else { - benchmark::BenchmarkOptions::Backfill + regenerate::DeriveOptions::Backfill } } else { - benchmark::BenchmarkOptions::Simple + regenerate::DeriveOptions::Simple }; - let res = benchmark::benchmark_derived_data( + let res = regenerate::regenerate_derived_data( &ctx, &repo, csids, @@ -661,7 +661,7 @@ async fn run_subcmd<'a>( ) .await?; - benchmark::print_benchmark_result(&res, sub_m.is_present(ARG_JSON))?; + regenerate::print_benchmark_result(&res, sub_m.is_present(ARG_JSON))?; Ok(()) } diff --git a/eden/mononoke/cmds/backfill_derived_data/benchmark.rs b/eden/mononoke/cmds/backfill_derived_data/regenerate.rs similarity index 95% rename from eden/mononoke/cmds/backfill_derived_data/benchmark.rs rename to eden/mononoke/cmds/backfill_derived_data/regenerate.rs index fef53929ba..252c4c7664 100644 --- a/eden/mononoke/cmds/backfill_derived_data/benchmark.rs +++ b/eden/mononoke/cmds/backfill_derived_data/regenerate.rs @@ -18,7 +18,7 @@ use serde::ser::SerializeStruct; use slog::debug; use std::{sync::Arc, time::Duration}; -pub enum BenchmarkOptions { +pub enum DeriveOptions { // Simple case - derive commits one by one Simple, // Derive commits one by one, but send all writes @@ -53,12 +53,12 @@ pub enum BenchmarkResult { }, } -pub async fn benchmark_derived_data( +pub async fn regenerate_derived_data( ctx: &CoreContext, repo: &BlobRepo, csids: Vec, derived_data_type: String, - opts: BenchmarkOptions, + opts: DeriveOptions, ) -> Result { let repo = repo.dangerous_override(|_| Arc::new(DummyLease {}) as Arc); @@ -72,7 +72,7 @@ pub async fn benchmark_derived_data( if !pending.is_empty() { return Err(anyhow!( "{} commits are not derived yet. \ - Benchmarking requires all commits to be derived. List of underived commits: {:?}", + Regenerating requires all commits to be derived. List of underived commits: {:?}", pending.len(), pending )); @@ -81,9 +81,9 @@ pub async fn benchmark_derived_data( derived_utils.regenerate(&csids); match opts { - BenchmarkOptions::Simple => derive_simple(&ctx, &repo, csids, derived_utils).await, - BenchmarkOptions::Backfill => derive_with_backfill(&ctx, &repo, csids, derived_utils).await, - BenchmarkOptions::BackfillParallel { batch_size } => { + DeriveOptions::Simple => derive_simple(&ctx, &repo, csids, derived_utils).await, + DeriveOptions::Backfill => derive_with_backfill(&ctx, &repo, csids, derived_utils).await, + DeriveOptions::BackfillParallel { batch_size } => { derive_with_parallel_backfill(&ctx, &repo, csids, derived_utils, batch_size).await } }