]> git.saurik.com Git - apt.git/commitdiff
apt-cache: stats: Average is over used, not all, buckets
authorJulian Andres Klode <jak@debian.org>
Sun, 3 Jan 2016 16:34:50 +0000 (17:34 +0100)
committerJulian Andres Klode <jak@debian.org>
Sun, 3 Jan 2016 16:34:50 +0000 (17:34 +0100)
It does not make sense to consider empty buckets in the
average, as they do not affect the lookup performance.

cmdline/apt-cache.cc

index 247f612c2a35bcfac2136b50cc91393be75fdb1f..7139bdeacde06409a60caa20bd978d361a2f6e9b 100644 (file)
@@ -172,7 +172,7 @@ static void ShowHashTableStats(std::string Type,
    cout << "Total buckets in " << Type << ": " << NumBuckets << std::endl;
    cout << "  Unused: " << UnusedBuckets << std::endl;
    cout << "  Used: " << UsedBuckets  << std::endl;
-   cout << "  Average entries: " << Entries/(double)NumBuckets << std::endl;
+   cout << "  Average entries: " << Entries/(double)UsedBuckets << std::endl;
    cout << "  Longest: " << LongestBucket << std::endl;
    cout << "  Shortest: " << ShortestBucket << std::endl;
 }