diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/profiler/output | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/profiler/output')
-rw-r--r-- | includes/profiler/output/ProfilerOutputDump.php | 6 | ||||
-rw-r--r-- | includes/profiler/output/ProfilerOutputStats.php | 6 | ||||
-rw-r--r-- | includes/profiler/output/ProfilerOutputText.php | 2 | ||||
-rw-r--r-- | includes/profiler/output/ProfilerOutputUdp.php | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/includes/profiler/output/ProfilerOutputDump.php b/includes/profiler/output/ProfilerOutputDump.php index bf4b85c2..09f56887 100644 --- a/includes/profiler/output/ProfilerOutputDump.php +++ b/includes/profiler/output/ProfilerOutputDump.php @@ -45,7 +45,11 @@ class ProfilerOutputDump extends ProfilerOutput { public function log( array $stats ) { $data = $this->collector->getRawData(); - $filename = sprintf( "%s/%s.%s%s", $this->params['outputDir'], uniqid(), $this->collector->getProfileID(), $this->suffix ); + $filename = sprintf( "%s/%s.%s%s", + $this->params['outputDir'], + uniqid(), + $this->collector->getProfileID(), + $this->suffix ); file_put_contents( $filename, serialize( $data ) ); } } diff --git a/includes/profiler/output/ProfilerOutputStats.php b/includes/profiler/output/ProfilerOutputStats.php index ef6ef7c9..52aa54ac 100644 --- a/includes/profiler/output/ProfilerOutputStats.php +++ b/includes/profiler/output/ProfilerOutputStats.php @@ -37,13 +37,11 @@ class ProfilerOutputStats extends ProfilerOutput { * @param array $stats */ public function log( array $stats ) { + $prefix = isset( $this->params['prefix'] ) ? $this->params['prefix'] : ''; $contextStats = $this->collector->getContext()->getStats(); foreach ( $stats as $stat ) { - // Sanitize the key - $key = str_replace( '::', '.', $stat['name'] ); - $key = preg_replace( '/[^a-z.]+/i', '_', $key ); - $key = trim( $key, '_.' ); + $key = "{$prefix}.{$stat['name']}"; // Convert fractional seconds to whole milliseconds $cpu = round( $stat['cpu'] * 1000 ); diff --git a/includes/profiler/output/ProfilerOutputText.php b/includes/profiler/output/ProfilerOutputText.php index 67527798..dc24f181 100644 --- a/includes/profiler/output/ProfilerOutputText.php +++ b/includes/profiler/output/ProfilerOutputText.php @@ -35,7 +35,7 @@ class ProfilerOutputText extends ProfilerOutput { parent::__construct( $collector, $params ); $this->thresholdMs = isset( $params['thresholdMs'] ) ? $params['thresholdMs'] - : .25; + : 1.0; } public function log( array $stats ) { if ( $this->collector->getTemplated() ) { diff --git a/includes/profiler/output/ProfilerOutputUdp.php b/includes/profiler/output/ProfilerOutputUdp.php index 7da03c11..a5626779 100644 --- a/includes/profiler/output/ProfilerOutputUdp.php +++ b/includes/profiler/output/ProfilerOutputUdp.php @@ -23,7 +23,7 @@ /** * ProfilerSimpleUDP class, that sends out messages for 'udpprofile' daemon - * (see http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile) + * (see https://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile) * * @ingroup Profiler * @since 1.25 |