24 use MediaWikiCoversValidator;
38 $timing->clearMarks(
'a' );
39 $this->
assertNull( $timing->getEntryByName(
'a' ) );
42 $timing->clearMarks();
54 $entry = $timing->getEntryByName(
'a' );
62 $newEntry = $timing->getEntryByName(
'a' );
76 $a = $timing->getEntryByName(
'a' );
77 $b = $timing->getEntryByName(
'b' );
79 $timing->measure(
'a_to_b',
'a',
'b' );
81 $entry = $timing->getEntryByName(
'a_to_b' );
84 $this->
assertEquals( $a[
'startTime'], $entry[
'startTime'] );
85 $this->
assertEquals( $b[
'startTime'] - $a[
'startTime'], $entry[
'duration'] );
94 $timing->
mark(
'mark_a' );
96 $timing->mark(
'mark_b' );
98 $timing->mark(
'mark_c' );
100 $timing->measure(
'measure_a',
'mark_a',
'mark_b' );
101 $timing->measure(
'measure_b',
'mark_b',
'mark_c' );
103 $marks =
array_map(
function ( $entry ) {
104 return $entry[
'name'];
105 }, $timing->getEntriesByType(
'mark' ) );
107 $this->
assertEquals( [
'requestStart',
'mark_a',
'mark_b',
'mark_c' ], $marks );
109 $measures =
array_map(
function ( $entry ) {
110 return $entry[
'name'];
111 }, $timing->getEntriesByType(
'measure' ) );
113 $this->
assertEquals( [
'measure_a',
'measure_b' ], $measures );
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
testMark()
Timing::mark Timing::getEntryByName.
testGetEntriesByType()
Timing::getEntriesByType.
testClearMarks()
Timing::clearMarks Timing::getEntries.
testMeasure()
Timing::measure.
An interface to help developers measure the performance of their applications.
mark( $markName)
Store a timestamp with the associated name (a "mark")