Merge "editstash: migrate ApiStashEdit to statslib"
This commit is contained in:
commit
65f6dcb558
2 changed files with 10 additions and 6 deletions
|
|
@ -176,7 +176,7 @@ class ApiMain extends ApiBase {
|
|||
'ContentHandlerFactory',
|
||||
'PageEditStash',
|
||||
'RevisionLookup',
|
||||
'StatsdDataFactory',
|
||||
'StatsFactory',
|
||||
'WikiPageFactory',
|
||||
'TempUserCreator',
|
||||
'UserFactory',
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ use MediaWiki\Storage\PageEditStash;
|
|||
use MediaWiki\User\TempUser\TempUserCreator;
|
||||
use MediaWiki\User\UserFactory;
|
||||
use Wikimedia\ParamValidator\ParamValidator;
|
||||
use Wikimedia\Stats\StatsFactory;
|
||||
|
||||
/**
|
||||
* Prepare an edit in shared cache so that it can be reused on edit
|
||||
|
|
@ -45,7 +46,7 @@ class ApiStashEdit extends ApiBase {
|
|||
private IContentHandlerFactory $contentHandlerFactory;
|
||||
private PageEditStash $pageEditStash;
|
||||
private RevisionLookup $revisionLookup;
|
||||
private IBufferingStatsdDataFactory $statsdDataFactory;
|
||||
private StatsFactory $stats;
|
||||
private WikiPageFactory $wikiPageFactory;
|
||||
private TempUserCreator $tempUserCreator;
|
||||
private UserFactory $userFactory;
|
||||
|
|
@ -56,7 +57,7 @@ class ApiStashEdit extends ApiBase {
|
|||
* @param IContentHandlerFactory $contentHandlerFactory
|
||||
* @param PageEditStash $pageEditStash
|
||||
* @param RevisionLookup $revisionLookup
|
||||
* @param IBufferingStatsdDataFactory $statsdDataFactory
|
||||
* @param StatsFactory $statsFactory
|
||||
* @param WikiPageFactory $wikiPageFactory
|
||||
* @param TempUserCreator $tempUserCreator
|
||||
* @param UserFactory $userFactory
|
||||
|
|
@ -67,7 +68,7 @@ class ApiStashEdit extends ApiBase {
|
|||
IContentHandlerFactory $contentHandlerFactory,
|
||||
PageEditStash $pageEditStash,
|
||||
RevisionLookup $revisionLookup,
|
||||
IBufferingStatsdDataFactory $statsdDataFactory,
|
||||
StatsFactory $statsFactory,
|
||||
WikiPageFactory $wikiPageFactory,
|
||||
TempUserCreator $tempUserCreator,
|
||||
UserFactory $userFactory
|
||||
|
|
@ -77,7 +78,7 @@ class ApiStashEdit extends ApiBase {
|
|||
$this->contentHandlerFactory = $contentHandlerFactory;
|
||||
$this->pageEditStash = $pageEditStash;
|
||||
$this->revisionLookup = $revisionLookup;
|
||||
$this->statsdDataFactory = $statsdDataFactory;
|
||||
$this->stats = $statsFactory;
|
||||
$this->wikiPageFactory = $wikiPageFactory;
|
||||
$this->tempUserCreator = $tempUserCreator;
|
||||
$this->userFactory = $userFactory;
|
||||
|
|
@ -201,7 +202,10 @@ class ApiStashEdit extends ApiBase {
|
|||
$this->pageEditStash->stashInputText( $text, $textHash );
|
||||
}
|
||||
|
||||
$this->statsdDataFactory->increment( "editstash.cache_stores.$status" );
|
||||
$this->stats->getCounter( 'editstash_cache_stores_total' )
|
||||
->setLabel( 'status', $status )
|
||||
->copyToStatsdAt( "editstash.cache_stores.$status" )
|
||||
->increment();
|
||||
|
||||
$ret = [ 'status' => $status ];
|
||||
// If we were rate-limited, we still return the pre-existing valid hash if one was passed
|
||||
|
|
|
|||
Loading…
Reference in a new issue