Avoid sending spammy @X xhprof entries over UDP
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 13 Nov 2014 21:01:25 +0000 (13:01 -0800)
committerBryanDavis <bdavis@wikimedia.org>
Fri, 14 Nov 2014 19:15:07 +0000 (19:15 +0000)
Change-Id: I8509932f7368cab2a5426f437845e2849a82d9b4

includes/profiler/ProfilerXhprof.php

index 1e83e27..5e70aa9 100644 (file)
@@ -284,6 +284,9 @@ class ProfilerXhprof extends Profiler {
                $buffer = '';
                $bufferSize = 0;
                foreach ( $metrics as $func => $data ) {
+                       if ( strpos( $func, '@' ) !== false ) {
+                               continue; // ignore cyclic re-entries to functions
+                       }
                        $line = sprintf( $wgUDPProfilerFormatString,
                                $this->getProfileID(),
                                $data['ct'],