public static function backfillMetrics($n, App $app)
    {
        $classes = self::metricClasses($app);

        $success = true;

        foreach ($classes as $metric) {
            if (!$metric->shouldBeCaptured()) {
                continue;
            }

            $i = 1;
            while ($i <= $n) {
                $success = $metric->savePeriod($i) && $success;

                ++$i;
            }
        }

        return $success;
    }