48 parent::__construct();
66 $key =
trim( $key,
'_.' );
71 $key,
$value = 1, $metric = StatsdDataInterface::STATSD_METRIC_COUNT
74 if ( !$this->enabled ) {
77 if ( $key !==
null ) {
79 $entity->setKey( $key );
82 $entity->setValue(
$value );
84 if ( $metric !==
null ) {
85 $entity->setMetric( $metric );
88 if ( !( $metric === StatsdDataInterface::STATSD_METRIC_COUNT && !
$value ) ) {
104 return !empty( $this->buffer );
120 return count( $this->buffer );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
A factory for application metric data.
hasData()
Check whether this data factory has any buffered data.
bool $enabled
Collection enabled?
produceStatsdData( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
clearData()
Clear all buffered data from the factory.
getDataCount()
Return the number of buffered statsd data entries.
static normalizeMetricKey( $key)
Normalize a metric key for StatsD.
setEnabled( $enabled)
Set collection enable status.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.