summaryrefslogtreecommitdiff
path: root/includes/profiler/ProfilerSimpleUDP.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/profiler/ProfilerSimpleUDP.php')
-rw-r--r--includes/profiler/ProfilerSimpleUDP.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/profiler/ProfilerSimpleUDP.php b/includes/profiler/ProfilerSimpleUDP.php
index abefa811..0a1f3b10 100644
--- a/includes/profiler/ProfilerSimpleUDP.php
+++ b/includes/profiler/ProfilerSimpleUDP.php
@@ -32,7 +32,7 @@ class ProfilerSimpleUDP extends ProfilerSimple {
}
public function logData() {
- global $wgUDPProfilerHost, $wgUDPProfilerPort;
+ global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgUDPProfilerFormatString;
$this->close();
@@ -41,24 +41,24 @@ class ProfilerSimpleUDP extends ProfilerSimple {
return;
}
- if ( !MWInit::functionExists( 'socket_create' ) ) {
+ if ( !function_exists( 'socket_create' ) ) {
# Sockets are not enabled
return;
}
- $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+ $sock = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
$plength = 0;
$packet = "";
foreach ( $this->mCollated as $entry => $pfdata ) {
- if( !isset( $pfdata['count'] )
+ if ( !isset( $pfdata['count'] )
|| !isset( $pfdata['cpu'] )
|| !isset( $pfdata['cpu_sq'] )
|| !isset( $pfdata['real'] )
|| !isset( $pfdata['real_sq'] ) ) {
continue;
}
- $pfline = sprintf( "%s %s %d %f %f %f %f %s\n", $this->getProfileID(), "-", $pfdata['count'],
- $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry);
+ $pfline = sprintf( $wgUDPProfilerFormatString, $this->getProfileID(), $pfdata['count'],
+ $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry );
$length = strlen( $pfline );
/* printf("<!-- $pfline -->"); */
if ( $length + $plength > 1400 ) {