Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/232379

Change subject: Fixed most BufferingStatsdDataFactory::timing() callers to use 
ms
......................................................................

Fixed most BufferingStatsdDataFactory::timing() callers to use ms

Change-Id: I1e334c2696a8a8eca73a6ae7f71428190cad3107
---
M includes/filerepo/file/File.php
M includes/jobqueue/JobRunner.php
M includes/objectcache/ObjectCacheSessionHandler.php
M includes/resourceloader/ResourceLoader.php
M includes/resourceloader/ResourceLoaderModule.php
5 files changed, 19 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/232379/1

diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index f9e1128..3677a14 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -423,7 +423,10 @@
                if ( !isset( $this->fsFile ) ) {
                        $starttime = microtime( true );
                        $this->fsFile = $this->repo->getLocalReference( 
$this->getPath() );
-                       RequestContext::getMain()->getStats()->timing( 
'media.thumbnail.generate.fetchoriginal', microtime( true ) - $starttime );
+
+                       $statTiming = microtime( true ) - $starttime;
+                       RequestContext::getMain()->getStats()->timing(
+                               'media.thumbnail.generate.fetchoriginal', 1000 
* $statTiming );
 
                        if ( !$this->fsFile ) {
                                $this->fsFile = false; // null => false; cache 
negative hits
@@ -1120,7 +1123,8 @@
                $thumb = $handler->doTransform( $this, $tmpThumbPath, 
$thumbUrl, $transformParams );
                $tmpFile->bind( $thumb ); // keep alive with $thumb
 
-               $stats->timing( 'media.thumbnail.generate.transform', 
microtime( true ) - $starttime );
+               $statTiming = microtime( true ) - $starttime;
+               $stats->timing( 'media.thumbnail.generate.transform', 1000 * 
$statTiming );
 
                if ( !$thumb ) { // bad params?
                        $thumb = false;
@@ -1143,7 +1147,8 @@
                                $thumb = $this->transformErrorOutput( 
$thumbPath, $thumbUrl, $transformParams, $flags );
                        }
 
-                       $stats->timing( 'media.thumbnail.generate.store', 
microtime( true ) - $starttime );
+                       $statTiming = microtime( true ) - $starttime;
+                       $stats->timing( 'media.thumbnail.generate.store', 1000 
* $statTiming );
 
                        // Give extensions a chance to do something with this 
thumbnail...
                        Hooks::run( 'FileTransformed', array( $this, $thumb, 
$tmpThumbPath, $thumbPath ) );
@@ -1180,8 +1185,6 @@
 
                $params = $this->getHandler()->sanitizeParamsForBucketing( 
$params );
 
-               $bucketName = $this->getBucketThumbName( $bucket );
-
                $tmpFile = $this->makeTransformTmpFile( $bucketPath );
 
                if ( !$tmpFile ) {
@@ -1201,7 +1204,8 @@
                // this object exists
                $tmpFile->bind( $this );
 
-               RequestContext::getMain()->getStats()->timing( 
'media.thumbnail.generate.bucket', $buckettime );
+               RequestContext::getMain()->getStats()->timing(
+                       'media.thumbnail.generate.bucket', 1000 * $buckettime );
 
                return true;
        }
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 2465e5a..ac5a6fd 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -203,8 +203,8 @@
                                if ( $readyTs ) {
                                        // Record time to run for the job type
                                        $pickupDelay = $popTime - $readyTs;
-                                       $stats->timing( 
'jobqueue.pickup_delay.all', $pickupDelay );
-                                       $stats->timing( 
"jobqueue.pickup_delay.$jType", $pickupDelay );
+                                       $stats->timing( 
'jobqueue.pickup_delay.all', 1000 * $pickupDelay );
+                                       $stats->timing( 
"jobqueue.pickup_delay.$jType", 1000 * $pickupDelay );
                                }
 
                                // Mark the job as done on success or when the 
job cannot be retried
diff --git a/includes/objectcache/ObjectCacheSessionHandler.php 
b/includes/objectcache/ObjectCacheSessionHandler.php
index 6a9b9a8..2a5d695 100644
--- a/includes/objectcache/ObjectCacheSessionHandler.php
+++ b/includes/objectcache/ObjectCacheSessionHandler.php
@@ -112,7 +112,7 @@
                $data = self::getCache()->get( self::getKey( $id ) );
                $real = microtime( true ) - $stime;
 
-               RequestContext::getMain()->getStats()->timing( "session.read", 
$real );
+               RequestContext::getMain()->getStats()->timing( "session.read", 
1000 * $real );
 
                self::$hashCache = array( $id => self::getHash( $data ) );
 
@@ -137,7 +137,7 @@
                        self::getCache()->set( self::getKey( $id ), $data, 
$wgObjectCacheSessionExpiry );
                        $real = microtime( true ) - $stime;
 
-                       RequestContext::getMain()->getStats()->timing( 
"session.write", $real );
+                       RequestContext::getMain()->getStats()->timing( 
"session.write", 1000 * $real );
                }
 
                return true;
@@ -154,7 +154,7 @@
                self::getCache()->delete( self::getKey( $id ) );
                $real = microtime( true ) - $stime;
 
-               RequestContext::getMain()->getStats()->timing( 
"session.destroy", $real );
+               RequestContext::getMain()->getStats()->timing( 
"session.destroy", 1000 * $real );
 
                return true;
        }
diff --git a/includes/resourceloader/ResourceLoader.php 
b/includes/resourceloader/ResourceLoader.php
index 090c4fd..cecb6a2 100644
--- a/includes/resourceloader/ResourceLoader.php
+++ b/includes/resourceloader/ResourceLoader.php
@@ -221,7 +221,8 @@
 
                                $result = self::applyFilter( $filter, $data, 
$this->config );
 
-                               $stats->timing( 
"resourceloader_cache.$filter.miss", microtime( true ) - $statStart );
+                               $statTiming = microtime( true ) - $statStart;
+                               $stats->timing( 
"resourceloader_cache.$filter.miss", 1000 * $statTiming );
                                if ( $options['cacheReport'] ) {
                                        $result .= "\n/* cache key: $key */";
                                }
diff --git a/includes/resourceloader/ResourceLoaderModule.php 
b/includes/resourceloader/ResourceLoaderModule.php
index ade99e2..1243f23 100644
--- a/includes/resourceloader/ResourceLoaderModule.php
+++ b/includes/resourceloader/ResourceLoaderModule.php
@@ -572,8 +572,8 @@
 
                $statTiming = microtime( true ) - $statStart;
                $statName = strtr( $this->getName(), '.', '_' );
-               $stats->timing( "resourceloader_build.all", $statTiming );
-               $stats->timing( "resourceloader_build.$statName", $statTiming );
+               $stats->timing( "resourceloader_build.all", 1000 * $statTiming 
);
+               $stats->timing( "resourceloader_build.$statName", 1000 * 
$statTiming );
 
                return $content;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/232379
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e334c2696a8a8eca73a6ae7f71428190cad3107
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to