Implement metrics.