Make MetricCounter a template class from which MetricCounterInt/Long come; add corresponding unittest.