Forráskód Böngészése

improve formating of the hash stats

Michael Vogt 12 éve
szülő
commit
eceb418be8
1 módosított fájl, 15 hozzáadás és 15 törlés
  1. 15 15
      cmdline/apt-cache.cc

+ 15 - 15
cmdline/apt-cache.cc

@@ -374,7 +374,7 @@ static bool Stats(CommandLine &)
            Cache->Head().ProvidesCount*Cache->Head().ProvidesSz;
            Cache->Head().ProvidesCount*Cache->Head().ProvidesSz;
    cout << _("Total space accounted for: ") << SizeToStr(Total) << endl;
    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 NumBuckets = sizeof(Cache->HeaderP->PkgHashTable)/sizeof(map_ptrloc);
    long UsedBuckets = 0;
    long UsedBuckets = 0;
    long UnusedBuckets = 0;
    long UnusedBuckets = 0;
@@ -395,14 +395,14 @@ static bool Stats(CommandLine &)
       ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
       ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
       UsedBuckets += ThisBucketSize;
       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);
    NumBuckets = sizeof(Cache->HeaderP->GrpHashTable)/sizeof(map_ptrloc);
    UsedBuckets = 0;
    UsedBuckets = 0;
    UnusedBuckets = 0;
    UnusedBuckets = 0;
@@ -423,12 +423,12 @@ static bool Stats(CommandLine &)
       ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
       ShortestBucket = std::min(ThisBucketSize, ShortestBucket);
       UsedBuckets += ThisBucketSize;
       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;
    return true;
 }
 }