protected function registerMetricRepository()
    {
        $this->app->singleton(MetricRepository::class, function (Container $app) {
            $config = $app->make(ConfigRepository::class);

            switch ($config->get('database.default')) {
                case 'mysql': $repository = new MySqlRepository($config); break;
                case 'pgsql': $repository = new PgSqlRepository($config); break;
                case 'sqlite': $repository = new SqliteRepository($config); break;
            }

            $dates = $app->make(DateFactory::class);

            return new MetricRepository($repository, $dates);
        });
    }