summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-06-18 08:51:59 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-06-18 08:51:59 +0200
commiteceb418be84f6271c10e374281c1a8379647679b (patch)
treef307542b00ef9396ce6ed7878104b360c50df3da
parent43f8819b7fbfd24c5013bbe3183cd85e10e77af3 (diff)
improve formating of the hash stats
-rw-r--r--cmdline/apt-cache.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index a620740e1..072cf4ef7 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -374,7 +374,7 @@ static bool Stats(CommandLine &)
Cache->Head().ProvidesCount*Cache->Head().ProvidesSz;
cout << _("Total space accounted for: ") << SizeToStr(Total) << endl;
- // get the hash collisions average
+ // hashtable stats for the PkgHashTable
long NumBuckets = sizeof(Cache->HeaderP->PkgHashTable)/sizeof(map_ptrloc);
long UsedBuckets = 0;
long UnusedBuckets = 0;
@@ -395,14 +395,14 @@ static bool Stats(CommandLine &)
ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
UsedBuckets += ThisBucketSize;
}
- cout << _("Pkg Hashtable stats:") << endl;
- cout << _("Number of buckets: ") << SizeToStr(NumBuckets) << endl;
- cout << _("Unused buckets: ") << SizeToStr(UnusedBuckets) << endl;
- cout << _("Used buckets: ") << UsedBuckets << endl;
- cout << _("Average num entries per bucket : ") << UsedBuckets/(double)NumBuckets << endl;
- cout << _("Longest / Shortest bucket: ") << LongestBucket << " / " << ShortestBucket << endl;
-
- // get the hash collisions average
+ cout << "Total PkgHashTable buckets: " << SizeToStr(NumBuckets) << std::endl;
+ cout << " Unused: " << SizeToStr(UnusedBuckets) << std::endl;
+ cout << " Used: " << UsedBuckets << std::endl;
+ cout << " Average entries: " << UsedBuckets/(double)NumBuckets << std::endl;
+ cout << " Longest: " << LongestBucket << std::endl;
+ cout << " Shortest: " << ShortestBucket << std::endl;
+
+ // hashtable stats for the GrpHashTable
NumBuckets = sizeof(Cache->HeaderP->GrpHashTable)/sizeof(map_ptrloc);
UsedBuckets = 0;
UnusedBuckets = 0;
@@ -423,12 +423,12 @@ static bool Stats(CommandLine &)
ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
UsedBuckets += ThisBucketSize;
}
- cout << _("Grp Hashtable stats:") << endl;
- cout << _("Number of buckets: ") << SizeToStr(NumBuckets) << endl;
- cout << _("Unused buckets: ") << SizeToStr(UnusedBuckets) << endl;
- cout << _("Used buckets: ") << UsedBuckets << endl;
- cout << _("Average num entries per bucket : ") << UsedBuckets/(double)NumBuckets << endl;
- cout << _("Longest / Shortest bucket: ") << LongestBucket << " / " << ShortestBucket << endl;
+ cout << "Total GrpHashTable buckets: " << SizeToStr(NumBuckets) << std::endl;
+ cout << " Unused: " << SizeToStr(UnusedBuckets) << std::endl;
+ cout << " Used: " << UsedBuckets << std::endl;
+ cout << " Average entries: " << UsedBuckets/(double)NumBuckets << std::endl;
+ cout << " Longest: " << LongestBucket << std::endl;
+ cout << " Shortest: " << ShortestBucket << std::endl;
return true;
}