Page MenuHomePhorge

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
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

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (11 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227407
Default Alt Text
(2 KB)

Event Timeline