r94834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94833‎ | r94834 | r94835 >
Date:22:38, 17 August 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Stylize

+upstream Wikia changes
Modified paths:
  • /trunk/phase3/includes/profiler/ProfilerSimpleUDP.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/profiler/ProfilerSimpleUDP.php
@@ -26,21 +26,28 @@
2727 }
2828
2929 $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
30 - $plength=0;
31 - $packet="";
32 - foreach ($this->mCollated as $entry=>$pfdata) {
33 - $pfline=sprintf ("%s %s %d %f %f %f %f %s\n", $this->getProfileID(),"-",$pfdata['count'],
34 - $pfdata['cpu'],$pfdata['cpu_sq'],$pfdata['real'],$pfdata['real_sq'],$entry);
35 - $length=strlen($pfline);
 30+ $plength = 0;
 31+ $packet = "";
 32+ foreach ( $this->mCollated as $entry => $pfdata ) {
 33+ if( !isset($pfdata['count'])
 34+ || !isset( $pfdata['cpu'] )
 35+ || !isset( $pfdata['cpu_sq'] )
 36+ || !isset( $pfdata['real'] )
 37+ || !isset( $pfdata['real_sq'] ) ) {
 38+ continue;
 39+ }
 40+ $pfline = sprintf( "%s %s %d %f %f %f %f %s\n", $this->getProfileID(), "-", $pfdata['count'],
 41+ $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry);
 42+ $length = strlen( $pfline );
3643 /* printf("<!-- $pfline -->"); */
37 - if ($length+$plength>1400) {
38 - socket_sendto($sock,$packet,$plength,0,$wgUDPProfilerHost,$wgUDPProfilerPort);
39 - $packet="";
40 - $plength=0;
 44+ if ( $length + $plength > 1400 ) {
 45+ socket_sendto( $sock, $packet, $plength, 0, $wgUDPProfilerHost, $wgUDPProfilerPort );
 46+ $packet = "";
 47+ $plength = 0;
4148 }
42 - $packet.=$pfline;
43 - $plength+=$length;
 49+ $packet .= $pfline;
 50+ $plength += $length;
4451 }
45 - socket_sendto($sock,$packet,$plength,0x100,$wgUDPProfilerHost,$wgUDPProfilerPort);
 52+ socket_sendto( $sock, $packet, $plength, 0x100, $wgUDPProfilerHost, $wgUDPProfilerPort );
4653 }
4754 }

Comments

#Comment by Nikerabbit (talk | contribs)   07:04, 18 August 2011

Mixing style and code updates? :(

Status & tagging log