Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Utils\Timing Class Reference

A helper class to make it easier to compute timing metrics. More...

Public Member Functions

 end (?string $statsdCompat=null, ?string $name=null, ?array $labels=[])
 End this timing measurement, reporting it under the given name.
 

Static Public Member Functions

static millis ()
 Return the current number of milliseconds since the epoch, as a float.
 
static fakeTiming (SiteConfig $siteConfig, float $value)
 Override elapsed time of a timing instance.
 
static start (?object $configOrMetrics=null)
 Start a timing measurement, logging it to the given $metrics object (which just needs to have a timing() method).
 

Detailed Description

A helper class to make it easier to compute timing metrics.

Member Function Documentation

◆ end()

Wikimedia\Parsoid\Utils\Timing::end ( ?string $statsdCompat = null,
?string $name = null,
?array $labels = [] )

End this timing measurement, reporting it under the given name.

Parameters
?string$statsdCompat
?string$name
?array$labels
Returns
float Number of milliseconds reported

◆ fakeTiming()

static Wikimedia\Parsoid\Utils\Timing::fakeTiming ( SiteConfig $siteConfig,
float $value )
static

Override elapsed time of a timing instance.

Parameters
SiteConfig$siteConfig
float$valueValue to measure in the metrics (milliseconds if timing)
Returns
Timing

◆ start()

static Wikimedia\Parsoid\Utils\Timing::start ( ?object $configOrMetrics = null)
static

Start a timing measurement, logging it to the given $metrics object (which just needs to have a timing() method).

Parameters
?object$configOrMetrics
Returns
Timing

The documentation for this class was generated from the following file: