/**
* Profiler wrapper for XHProf extension.
*
- * Mimics the output of ProfilerStandard using data collected via the XHProf
- * PHP extension.
- *
* @code
* $wgProfiler['class'] = 'ProfilerXhprof';
* $wgProfiler['flags'] = XHPROF_FLAGS_NO_BUILTINS;
* $wgProfiler['output'] = 'udp';
* @endcode
*
- * Rather than obeying wfProfileIn() and wfProfileOut() calls placed in the
- * application code, ProfilerXhprof profiles all functions using the XHProf
- * PHP extenstion. For PHP5 users, this extension can be installed via PECL or
- * your operating system's package manager. XHProf support is built into HHVM.
+ * ProfilerXhprof profiles all functions using the XHProf PHP extenstion.
+ * For PHP5 users, this extension can be installed via PECL or your operating
+ * system's package manager. XHProf support is built into HHVM.
*
* To restrict the functions for which profiling data is collected, you can
* use either a whitelist ($wgProfiler['include']) or a blacklist
$this->sprofiler = new SectionProfiler();
}
- /**
- * No-op for xhprof profiling.
- *
- * Use the 'include' configuration key instead if you need to constrain
- * the functions that are profiled.
- *
- * @param string $functionname
- */
- public function profileIn( $functionname ) {
- }
-
- /**
- * No-op for xhprof profiling.
- *
- * Use the 'include' configuration key instead if you need to constrain
- * the functions that are profiled.
- *
- * @param string $functionname
- */
- public function profileOut( $functionname ) {
- }
-
public function scopedProfileIn( $section ) {
return $this->sprofiler->scopedProfileIn( $section );
}
$main = null; // units in ms
foreach ( $metrics as $fname => $stats ) {
- // Convert elapsed times from μs to ms to match ProfilerStandard
+ // Convert elapsed times from μs to ms to match interface
$entry = array(
'name' => $fname,
'calls' => $stats['ct'],
}
return implode( "\n", $out );
}
+
+ /**
+ * Retrieve raw data from xhprof
+ * @return array
+ */
+ public function getRawData() {
+ return $this->xhprof->getRawData();
+ }
}