Skip to content

Commit fd822cf

Browse files
committed
fix StatsFactory timing usage in EditEntity and View
* remove deprecated use of copyToStatsdAt * remove deprecated use of TimingMetric->stop TimingMetric->start() returns a RunningTimer instance that works around the recursion use case (T368073) Bug: T245464 Change-Id: I2f5c8bb4726359473ef91eeb4f2d00d2b6c999f7
1 parent 6cf6a75 commit fd822cf

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

repo/includes/EditEntity/StatslibSaveTimeRecordingEditEntity.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ public function attemptSave(
9494
$timing = $this->statsFactory
9595
->getTiming( 'EditEntity_attemptSave_duration_seconds' )
9696
->setLabel( 'type', $newEntity->getType() )
97-
->copyToStatsdAt( "wikibase.repo.EditEntity.timing.EditEntity.attemptSave.{$newEntity->getType()}" );
98-
99-
$timing->start();
97+
->start();
10098
$result = $this->inner->attemptSave( $newEntity, $summary, $flags, $token, $watch, $tags );
10199
$timing->stop();
102100

repo/includes/EditEntity/StatslibSaveTimeRecordingEntityStore.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public function saveEntity(
4949
$timing = $this->statsFactory
5050
->getTiming( 'EditEntity_EntityStore_saveEntity_duration_seconds' )
5151
->setLabel( 'type', $entity->getType() )
52-
->copyToStatsdAt( "wikibase.repo.EditEntity.timing.EntityStore.saveEntity.{$entity->getType()}" );
53-
54-
$timing->start();
52+
->start();
5553
$result = $this->entityStore->saveEntity( $entity, $summary, $user, $flags, $baseRevId, $tags );
5654
$timing->stop();
5755

view/src/FallbackChainModuleMethods.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ function () use ( $services ) {
2525
$statsFactory = $services->getStatsFactory()->withComponent( 'WikibaseRepo' );
2626
$timing = $statsFactory
2727
->getTiming( 'fallbackchains_timing_seconds' )
28-
->copyToStatsdAt( 'wikibase.view.fallbackchains.timing' );
29-
$timing->start();
28+
->start();
3029

3130
$fallbackChainFactory = WikibaseRepo::getLanguageFallbackChainFactory( $services );
3231
$languages = WikibaseRepo::getTermsLanguages( $services )->getLanguages();

0 commit comments

Comments
 (0)