public function remove($metricCategory, $metricName = false)
    {
        foreach ($this->metrics as $index => $metric) {
            if ($metric->getCategoryId() === $metricCategory) {
                if (!$metricName || $metric->getName() === $metricName) {
                    unset($this->metrics[$index]);
                    $this->metricsByNameCache = array();
                }
            }
        }
    }