Browse Source

apt-cache: stats: Average is over used, not all, buckets

It does not make sense to consider empty buckets in the
average, as they do not affect the lookup performance.
Julian Andres Klode 10 years ago
parent
commit
6d7fc45ed4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cmdline/apt-cache.cc

+ 1 - 1
cmdline/apt-cache.cc

@@ -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;
 }