Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F584918
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/includes/ResourceLoader/Module.php b/includes/ResourceLoader/Module.php
index 290ee58bb5b..24bb502d44d 100644
--- a/includes/ResourceLoader/Module.php
+++ b/includes/ResourceLoader/Module.php
@@ -745,7 +745,7 @@ abstract class Module implements LoggerAwareInterface {
*/
final protected function buildContent( Context $context ) {
$statsFactory = MediaWikiServices::getInstance()->getStatsFactory();
- $statStart = microtime( true );
+ $statStart = hrtime( true );
// This MUST build both scripts and styles, regardless of whether $context->getOnly()
// is 'scripts' or 'styles' because the result is used by getVersionHash which
@@ -821,16 +821,14 @@ abstract class Module implements LoggerAwareInterface {
$content['deprecationWarning'] = $deprecationWarning;
}
- $statTiming = microtime( true ) - $statStart;
$statName = strtr( $this->getName(), '.', '_' );
-
$statsFactory->getTiming( 'resourceloader_build_seconds' )
->setLabel( 'name', $statName )
->copyToStatsdAt( [
'resourceloader_build.all',
"resourceloader_build.$statName",
] )
- ->observe( 1000 * $statTiming );
+ ->observeNanoseconds( hrtime( true ) - $statStart );
return $content;
}
diff --git a/includes/ResourceLoader/ResourceLoader.php b/includes/ResourceLoader/ResourceLoader.php
index 9750f28d6a5..48f961637f2 100644
--- a/includes/ResourceLoader/ResourceLoader.php
+++ b/includes/ResourceLoader/ResourceLoader.php
@@ -789,9 +789,9 @@ class ResourceLoader implements LoggerAwareInterface {
* @return ScopedCallback
*/
protected function measureResponseTime() {
- $statStart = $_SERVER['REQUEST_TIME_FLOAT'];
- return new ScopedCallback( function () use ( $statStart ) {
- $statTiming = microtime( true ) - $statStart;
+ $requestStart = $_SERVER['REQUEST_TIME_FLOAT'];
+ return new ScopedCallback( function () use ( $requestStart ) {
+ $statTiming = microtime( true ) - $requestStart;
$this->statsFactory->getTiming( 'resourceloader_response_time_seconds' )
->copyToStatsdAt( 'resourceloader.responseTime' )
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (8 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227407
Default Alt Text
(2 KB)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment