Gets grace period

@return int
433603
public function getGraceTtl()
    {
        if (!isset($this->graceTtl)) {
            $this->graceTtl = self::DEFAULT_GRACE_TTL;
        }

        return $this->graceTtl;
    }
1187635
public function getDuration()
    {
        if (null === $this->data) {
            return 0;
        }

        $time = 0;
        foreach ($this->data as $data) {
            $time += $data['duration'];
        }

        return $time;
    }
701208
public function getYear(): Period
    {
        $year = (int) $this->format('Y');
        $datepoint = $this->setTime(0, 0);

        return new Period($datepoint->setDate($year, 1, 1), $datepoint->setDate(++$year, 1, 1));
    }
1284698
public function calculateAge()
    {
        $age = $this->getHeader('Age');

        if ($age === null && $this->getDate()) {
            $age = time() - strtotime($this->getDate());
        }

        return $age === null ? null : (int) (string) $age;
    }
855675
public function getMaxAge()
    {
        if ($header = $this->getHeader('Cache-Control')) {
            // s-max-age, then max-age, then Expires
            if ($age = $header->getDirective('s-maxage')) {
                return $age;
            }
            if ($age = $header->getDirective('max-age')) {
                return $age;
            }
        }

        if ($this->getHeader('Expires')) {
            return strtotime($this->getExpires()) - time();
        }

        return null;
    }
83276
public function getMonitorPeriod($name = null)
    {
        if ($name) {
            if (isset($this['monitor'], $this['monitor'][$name], $this['monitor'][$name]['period']) &&
                    strlen(trim($this['monitor'][$name]['period']))) {
                return $this['monitor'][$name]['period'];
            }
        }

        if (isset($this['monitor'], $this['monitor']['default'], $this['monitor']['default']['period']) &&
                strlen(trim($this['monitor']['default']['period']))) {
            return $this['monitor']['default']['period'];
        }

        return '25h';
    }
178686
public function getDuration()
    {
        $name = trim((string) $this->getParameter('name'));
        $fullPage = StringUtils::strToBool((string)$this->getParameter('FullPage'));
        if (empty($name))
            $name = 'default';

        if (in_array($name, explode(',', 'none,never,off,0,zero,no')))
            return 0;

        if (!array_key_exists($name, $this->durations))
            $name = 'default';

        $duration = abs((int)$this->durations[$name]);

        if (!$fullPage || $duration < 1)
            return $duration;

        // full page cache duration should be half the cache time
        return ceil($duration/2);
    }
898764
public function getEasterDate()
    {
        $easter = new \DateTime($this->getYear() . '-03-21');
        $days   = easter_days($this->getYear());

        return $easter->add(new DateInterval('P' . $days . 'D'));
    }
1253790
public function getLastAdminActivityAgo()
    {
        $now = \Yii::$app->formatter->asTimestamp(time());
        return (int)($now - (int)$this->last_admin_activity_at);
    }
204725
public function getTimestamp()
    {
        if ($this->isNull($this->value)) {
            return null;
        }
        $value = strtotime($this->getValue());

        return $value ?: null;
    }
86073
public function getReleasedAt() : ?int 
    {
        if ( ! $this->hasReleasedAt()) {
            $this->setReleasedAt($this->getDefaultReleasedAt());
        }
        return $this->releasedAt;
    }
299009
public function duration()
    {
        $start = $this->startDateTime();
        $end = $this->endDateTime();

        $dateDifference = $start->diff($end);

        $dateInterval = new DateInterval('PT1S');
        $dateInterval->y = $dateDifference->y;
        $dateInterval->m = $dateDifference->m;
        $dateInterval->d = $dateDifference->d;
        $dateInterval->h = $dateDifference->h;
        $dateInterval->i = $dateDifference->i;
        $dateInterval->s = $dateDifference->s;
        $dateInterval->invert = $dateDifference->invert;
        $dateInterval->days = $dateDifference->days;

        return $dateInterval;
    }
624982
public function getExpiresInterval()
    {
        if (!$this->expiresAt) return '';
        $now = new \DateTime();
        $interval = $now->diff($this->expiresAt);
        if ($interval->days == 1)
            return $interval->format('%a jour');
        elseif ($interval->days > 1)
            return $interval->format('%a jours');
        elseif ($interval->h == 1)
            return $interval->format('%h heure');
        else
            return $interval->format('%h heures');
    }
953086
public function getExecutionTime()
    {
        $seconds = $this->getTime() - $this->startTime;

        $seconds = round($seconds);
        if ($seconds < 60) {
            return $seconds . ' sec';
        }
        $minutes = round($seconds / 60);
        $seconds = $seconds % 60;

        return $minutes . ' min ' . $seconds . ' sec';
    }
865700
public function getMonth(): Period
    {
        $startDate = $this
            ->setTime(0, 0)
            ->setDate((int) $this->format('Y'), (int) $this->format('n'), 1);

        return new Period($startDate, $startDate->add(new DateInterval('P1M')));
    }
237245
public function getDuration()
	{
		$started = (is_null($this->started)) ? new \DateTime('now') : $this->started;
		$stopped = (is_null($this->stopped)) ? new \DateTime('now') : $this->stopped;

		return $started->diff($stopped);
	}
98385
public function getMeanGenerationTime(){
        if(!$this->is_setup) return;
        if(!$this->statistics_tab){
            $this->getStatisticsByGeneration();
        }
        //Linear regression on x=generation and y=birthdate
        $sum_xy = 0;
        $sum_x=0;
        $sum_y=0;
        $sum_x2=0;
        $n=count($this->statistics_tab);
        foreach($this->statistics_tab as $gen=>$stats){
            $sum_xy+=$gen*$stats['avgBirth'];
            $sum_x+=$gen;
            $sum_y+=$stats['avgBirth'];
            $sum_x2+=$gen*$gen;
        }
        $denom=($n*$sum_x2)-($sum_x*$sum_x);
        if($denom!=0){
            return -(($n*$sum_xy)-($sum_x*$sum_y))/($denom);
        }
        return null;
    }