45class Timing implements LoggerAwareInterface {
75 public function mark( $markName ) {
78 'entryType' =>
'mark',
90 if ( $markName !==
null ) {
91 unset( $this->entries[$markName] );
95 'name' =>
'requestStart',
96 'entryType' =>
'mark',
97 'startTime' => $_SERVER[
'REQUEST_TIME_FLOAT'],
124 public function measure( $measureName, $startMark =
'requestStart', $endMark =
null ) {
126 if ( $start ===
null ) {
127 $this->logger->error( __METHOD__ .
": The mark '$startMark' does not exist" );
130 $startTime = $start[
'startTime'];
134 if ( $end ===
null ) {
135 $this->logger->error( __METHOD__ .
": The mark '$endMark' does not exist" );
138 $endTime = $end[
'startTime'];
145 'entryType' =>
'measure',
146 'startTime' => $startTime,
147 'duration' => $endTime - $startTime,
157 uasort( $this->entries,
function ( $a, $b ) {
158 return $a[
'startTime'] <=> $b[
'startTime'];
178 foreach ( $this->entries as $entry ) {
179 if ( $entry[
'entryType'] === $entryType ) {
191 return $this->entries[
$name] ??
null;
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
An interface to help developers measure the performance of their applications.
sortEntries()
Sort entries in chronological order with respect to startTime.
clearMarks( $markName=null)
mark( $markName)
Store a timestamp with the associated name (a "mark")
getEntriesByType( $entryType)
measure( $measureName, $startMark='requestStart', $endMark=null)
This method stores the duration between two marks along with the associated name (a "measure").
setLogger(LoggerInterface $logger)
Sets a logger instance on the object.
__construct(array $params=[])
Allows to change the fields on the form that will be generated $name
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))