Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1427248
NullStatsdDataFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
NullStatsdDataFactory.php
View Options
<?php
namespace
Wikimedia\Stats
;
use
Liuggio\StatsdClient\Entity\StatsdData
;
use
Liuggio\StatsdClient\Entity\StatsdDataInterface
;
/**
* @author Addshore
* @since 1.27
*/
class
NullStatsdDataFactory
implements
IBufferingStatsdDataFactory
{
/**
* This function creates a 'timing' StatsdData.
*
* @param string|array $key The metric(s) to set.
* @param float $time The elapsed time (ms) to log
*/
public
function
timing
(
$key
,
$time
)
{
}
/**
* This function creates a 'gauge' StatsdData.
*
* @param string|array $key The metric(s) to set.
* @param float $value The value for the stats.
*/
public
function
gauge
(
$key
,
$value
)
{
}
/**
* This function creates a 'set' StatsdData object
* A "Set" is a count of unique events.
* This data type acts like a counter, but supports counting
* of unique occurrences of values between flushes. The backend
* receives the number of unique events that happened since
* the last flush.
*
* The reference use case involved tracking the number of active
* and logged in users by sending the current userId of a user
* with each request with a key of "uniques" (or similar).
*
* @param string|array $key The metric(s) to set.
* @param float $value The value for the stats.
*
* @return array
*/
public
function
set
(
$key
,
$value
)
{
return
[];
}
/**
* This function creates a 'increment' StatsdData object.
*
* @param string|array $key The metric(s) to increment.
*
* @return array
*/
public
function
increment
(
$key
)
{
return
[];
}
/**
* This function creates a 'decrement' StatsdData object.
*
*
* @param string|array $key The metric(s) to decrement.
*
* @return mixed
*/
public
function
decrement
(
$key
)
{
return
[];
}
/**
* This function creates a 'updateCount' StatsdData object.
*
* @param string|array $key The metric(s) to decrement.
* @param int $delta The delta to add to the each metric
*
* @return mixed
*/
public
function
updateCount
(
$key
,
$delta
)
{
return
[];
}
/**
* Produce a StatsdDataInterface Object.
*
* @param string $key The key of the metric
* @param int $value The amount to increment/decrement each metric by.
* @param string $metric The metric type
* ("c" for count, "ms" for timing, "g" for gauge, "s" for set)
*
* @return StatsdDataInterface
*/
public
function
produceStatsdData
(
$key
,
$value
=
1
,
$metric
=
StatsdDataInterface
::
STATSD_METRIC_COUNT
)
{
$data
=
new
StatsdData
();
$data
->
setKey
(
$key
);
$data
->
setValue
(
$value
);
$data
->
setMetric
(
$metric
);
return
$data
;
}
public
function
hasData
()
{
return
false
;
}
public
function
getData
()
{
return
[];
}
public
function
clearData
()
{
// Nothing to do, always empty
}
public
function
getDataCount
()
{
return
0
;
}
public
function
setEnabled
(
$enabled
)
{
// Nothing to do, null factory is always disabled.
}
}
/** @deprecated class alias since 1.43 */
class_alias
(
NullStatsdDataFactory
::
class
,
'NullStatsdDataFactory'
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 14:24 (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0c/c5/14c511c410946f719950641bb71d
Default Alt Text
NullStatsdDataFactory.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment