Compactness by the Hausdorff measure of noncompactness