From 95ed50db45a143004f0cf65b3736833c4fb87418 Mon Sep 17 00:00:00 2001 From: Daniel Grzegorzewski Date: Mon, 30 Sep 2019 07:19:45 -0700 Subject: [PATCH] Moved info logging to log_statistics function Summary: print_statistics and log_statistics were used in the same places in code. Reviewed By: StanislavGlebik Differential Revision: D17665790 fbshipit-source-id: 5d41f1b9d77edbe12db25f109a8bb171c8072fb4 --- cmds/statistics_collector.rs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/cmds/statistics_collector.rs b/cmds/statistics_collector.rs index 4de0be78af..da23f2c486 100644 --- a/cmds/statistics_collector.rs +++ b/cmds/statistics_collector.rs @@ -234,9 +234,11 @@ pub fn update_statistics( .map(move |statistics| statistics) } -pub fn print_statistics( +pub fn log_statistics( ctx: CoreContext, + mut scuba_logger: ScubaSampleBuilder, cs_timestamp: i64, + repo_name: String, hg_cs_id: HgChangesetId, statistics: RepoStatistics, ) { @@ -249,15 +251,6 @@ pub fn print_statistics( statistics.total_file_size, statistics.num_lines ); -} - -pub fn log_statistics( - mut scuba_logger: ScubaSampleBuilder, - cs_timestamp: i64, - repo_name: String, - hg_cs_id: HgChangesetId, - statistics: RepoStatistics, -) { scuba_logger .add("repo_name", repo_name) .add("num_files", statistics.num_files) @@ -322,8 +315,8 @@ fn main(fb: FacebookInit) -> Result<(), Error> { changeset, ) .map(move |cs_timestamp| { - print_statistics(ctx, cs_timestamp, changeset, statistics); log_statistics( + ctx, scuba_logger, cs_timestamp, repo_name, @@ -389,13 +382,8 @@ fn main(fb: FacebookInit) -> Result<(), Error> { cur_changeset, ) .map(move |cs_timestamp| { - print_statistics( - ctx, - cs_timestamp, - cur_changeset, - statistics, - ); log_statistics( + ctx, scuba_logger, cs_timestamp, repo_name,