+ /** @var int port to send profiling data to */
+ private $port = 3811;
+
+ /** @var string host to send profiling data to */
+ private $host = '127.0.0.1';
+
+ /** @var string format string for profiling data */
+ private $format = "%s - %d %f %f %f %f %s\n";
+
+ public function __construct( Profiler $collector, array $params ) {
+ parent::__construct( $collector, $params );
+ global $wgUDPProfilerPort, $wgUDPProfilerHost, $wgUDPProfilerFormatString;
+
+ // Initialize port, host, and format from config, back-compat if available
+ if ( isset( $this->params['udpport'] ) ) {
+ $this->port = $this->params['udpport'];
+ } elseif( $wgUDPProfilerPort ) {
+ $this->port = $wgUDPProfilerPort;
+ }
+
+ if ( isset( $this->params['udphost'] ) ) {
+ $this->host = $this->params['udphost'];
+ } elseif( $wgUDPProfilerHost ) {
+ $this->host = $wgUDPProfilerHost;
+ }
+
+ if ( isset( $this->params['udpformat'] ) ) {
+ $this->format = $this->params['udpformat'];
+ } elseif( $wgUDPProfilerFormatString ) {
+ $this->format = $wgUDPProfilerFormatString;
+ }
+ }
+