```{index} single: bucket_stats (Hash::Util) ``` ```{index} single: Hash::Util::bucket_stats ``` # bucket_stats Return a rich statistical summary of the hash's bucket layout. ## Synopsis ```perl my ($keys, $buckets, $used, $quality, $utilization_ratio, $collision_pct, $mean, $stddev, @length_counts) = bucket_stats(\%hash); ``` Extends `bucket_info` with derived quantities: `$quality` is the Red-Dragon quality score (ideal `1.0`, acceptable around `0.95` to `1.05`, worse as the number grows), `$utilization_ratio` is the fraction of used buckets, `$collision_pct` is the fraction of keys that are not first in their bucket chain (`($keys - $used) / $keys`), and `$mean` and `$stddev` describe the bucket-chain-length distribution over used buckets. For an empty hash, only `$keys`, `$buckets`, and `$used` are returned - the statistical block is skipped.