macos compatible + HashMapMetrics