MediaWiki
master
SequenceSpec.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\WRStats
;
4
10
class
SequenceSpec
{
12
public
const
DEFAULT_TIME_STEP
= 600;
13
15
public
const
DEFAULT_EXPIRY
= 3600;
16
18
public
$name
;
20
public
$timeStep
;
22
public
$softExpiry
;
24
public
$hardExpiry
;
25
29
public
function
__construct
( array $spec ) {
30
$this->timeStep = $spec[
'timeStep'
] ??
self::DEFAULT_TIME_STEP
;
31
$this->softExpiry = $spec[
'expiry'
] ??
self::DEFAULT_EXPIRY
;
32
$this->hardExpiry = (int)ceil( $this->softExpiry + $this->timeStep );
33
$this->name = $spec[
'name'
] ??
''
;
34
}
35
}
Wikimedia\WRStats\SequenceSpec
Class representation of normalized sequence specifications.
Definition
SequenceSpec.php:10
Wikimedia\WRStats\SequenceSpec\DEFAULT_EXPIRY
const DEFAULT_EXPIRY
The default expiry time (seconds)
Definition
SequenceSpec.php:15
Wikimedia\WRStats\SequenceSpec\$hardExpiry
int $hardExpiry
Definition
SequenceSpec.php:24
Wikimedia\WRStats\SequenceSpec\__construct
__construct(array $spec)
Definition
SequenceSpec.php:29
Wikimedia\WRStats\SequenceSpec\$timeStep
float int $timeStep
Definition
SequenceSpec.php:20
Wikimedia\WRStats\SequenceSpec\DEFAULT_TIME_STEP
const DEFAULT_TIME_STEP
The default time bucket size (seconds)
Definition
SequenceSpec.php:12
Wikimedia\WRStats\SequenceSpec\$name
string $name
Definition
SequenceSpec.php:18
Wikimedia\WRStats\SequenceSpec\$softExpiry
float int $softExpiry
Definition
SequenceSpec.php:22
Wikimedia\WRStats
Definition
ArrayStatsStore.php:3
includes
libs
WRStats
SequenceSpec.php
Generated on Wed Dec 4 2024 14:24:45 for MediaWiki by
1.10.0