Send edit stash metrics for cache attempts

Change-Id: Ic5ffcb20ca9062748c2cde232d6aa4ee1522aa55
This commit is contained in:
Aaron Schulz 2016-05-26 12:46:55 -07:00
parent 6d9ae3c638
commit 838d5bc7e4

View file

@ -140,10 +140,11 @@ class ApiVisualEditor extends ApiBase {
$page = WikiPage::factory( $title ); $page = WikiPage::factory( $title );
$content = ContentHandler::makeContent( $text, $title, CONTENT_MODEL_WIKITEXT ); $content = ContentHandler::makeContent( $text, $title, CONTENT_MODEL_WIKITEXT );
$res = ApiStashEdit::parseAndStash( $page, $content, $this->getUser() ); $status = ApiStashEdit::parseAndStash( $page, $content, $this->getUser() );
if ( $res === ApiStashEdit::ERROR_NONE ) { if ( $status === ApiStashEdit::ERROR_NONE ) {
wfDebugLog( 'StashEdit', "Cached parser output for VE content key '$key'." ); wfDebugLog( 'StashEdit', "Cached parser output for VE content key '$key'." );
} }
$this->getStats()->increment( "editstash.ve_cache_stores.$status" );
return $hash; return $hash;
} }