public function get($commandKey, Config $commandConfig)
    {
        if (!isset($this->commandMetricsByCommand[$commandKey])) {
            $metricsConfig = $commandConfig->get('metrics');
            $statisticalWindow = $metricsConfig->get('rollingStatisticalWindowInMilliseconds');
            $windowBuckets = $metricsConfig->get('rollingStatisticalWindowBuckets');
            $snapshotInterval = $metricsConfig->get('healthSnapshotIntervalInMilliseconds');

            $counter = new MetricsCounter($commandKey, $this->stateStorage, $statisticalWindow, $windowBuckets);
            $this->commandMetricsByCommand[$commandKey] = new CommandMetrics($counter, $snapshotInterval);
        }

        return $this->commandMetricsByCommand[$commandKey];
    }