Functionality common to all metric types.
More...
Functionality common to all metric types.
- Author
- Cole White
- Since
- 1.38
Definition at line 33 of file StatsUtils.php.
◆ getFilteredSamples()
static Wikimedia\Stats\StatsUtils::getFilteredSamples |
( |
float | $sampleRate, |
|
|
array | $samples ) |
|
static |
Returns a subset of samples based on configured sample rate.
- Parameters
-
float | $sampleRate | |
array | $samples | |
- Returns
- array
Definition at line 57 of file StatsUtils.php.
◆ normalizeArray()
static Wikimedia\Stats\StatsUtils::normalizeArray |
( |
array | $entities | ) |
|
|
static |
Normalize an array of strings.
- Parameters
-
- Returns
- string[]
Definition at line 117 of file StatsUtils.php.
◆ normalizeString()
static Wikimedia\Stats\StatsUtils::normalizeString |
( |
string | $entity | ) |
|
|
static |
◆ validateLabelKey()
static Wikimedia\Stats\StatsUtils::validateLabelKey |
( |
string | $key | ) |
|
|
static |
Determines if provided string is a valid label key.
- Parameters
-
- Returns
- void
- Exceptions
-
InvalidArgumentException | |
InvalidConfigurationException | |
Definition at line 96 of file StatsUtils.php.
◆ validateLabelValue()
static Wikimedia\Stats\StatsUtils::validateLabelValue |
( |
string | $value | ) |
|
|
static |
◆ validateMetricName()
static Wikimedia\Stats\StatsUtils::validateMetricName |
( |
string | $name | ) |
|
|
static |
Determines if provided string is a valid name.
- Parameters
-
- Returns
- void
- Exceptions
-
InvalidArgumentException | |
InvalidConfigurationException | |
Definition at line 79 of file StatsUtils.php.
◆ validateNewSampleRate()
static Wikimedia\Stats\StatsUtils::validateNewSampleRate |
( |
float | $newSampleRate | ) |
|
|
static |
Validates the new sample rate.
Throws InvalidArgumentException if provided an invalid rate.
- Parameters
-
- Exceptions
-
Definition at line 44 of file StatsUtils.php.
◆ DEFAULT_SAMPLE_RATE
const Wikimedia\Stats\StatsUtils::DEFAULT_SAMPLE_RATE = 1.0 |
◆ RE_VALID_NAME_AND_LABEL_NAME
const Wikimedia\Stats\StatsUtils::RE_VALID_NAME_AND_LABEL_NAME = "/^[a-zA-Z_][a-zA-Z0-9_]*$/" |
The documentation for this class was generated from the following file: