Add COUNTER metric type. Fixes #795.