reduce with hash and metrics