made CountMetric and MultiCountMetric serializable