From 56337faf3e76120980026669f6689836179f5966 Mon Sep 17 00:00:00 2001 From: Mark Callaghan Date: Mon, 16 Mar 2015 11:50:23 -0700 Subject: [PATCH] Fix compaction IO stats to handle large file counts Summary: The output did not have space for 6-digit file counts or for 3-digit counts of files being compacted. This adds space for that while preserving existing alignment. See https://gist.github.com/mdcallag/0a61c6a18dd467224c11 Task ID: # Blame Rev: Test Plan: run db_bench, look at output Revert Plan: Database Impact: Memcache Impact: Other Notes: EImportant: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Reviewers: igor Reviewed By: igor Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D35091 --- db/internal_stats.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/internal_stats.cc b/db/internal_stats.cc index 5745156a4..33866711c 100644 --- a/db/internal_stats.cc +++ b/db/internal_stats.cc @@ -30,7 +30,7 @@ void PrintLevelStatsHeader(char* buf, size_t len, const std::string& cf_name) { snprintf( buf, len, "\n** Compaction Stats [%s] **\n" - "Level Files Size(MB) Score Read(GB) Rn(GB) Rnp1(GB) " + "Level Files Size(MB) Score Read(GB) Rn(GB) Rnp1(GB) " "Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) " "Comp(sec) Comp(cnt) Avg(sec) " "Stall(cnt) KeyIn KeyDrop\n" @@ -52,7 +52,7 @@ void PrintLevelStats(char* buf, size_t len, const std::string& name, NumberToHumanString(stats.num_dropped_records); snprintf(buf, len, - "%4s %5d/%-3d %8.0f %5.1f " /* Level, Files, Size(MB), Score */ + "%4s %6d/%-3d %8.0f %5.1f " /* Level, Files, Size(MB), Score */ "%8.1f " /* Read(GB) */ "%7.1f " /* Rn(GB) */ "%8.1f " /* Rnp1(GB) */