Wikibase
MediaWiki Wikibase extension
|
EntityStore that collects stats for edit save times. More...
Public Member Functions | |
__construct (EntityStore $entityStore, StatsdDataFactoryInterface $stats, string $timingPrefix) | |
assignFreshId (EntityDocument $entity) | |
Assigns a fresh ID to the given entity. More... | |
saveEntity (EntityDocument $entity, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) | |
Saves the given Entity to some underlying storage mechanism. More... | |
saveRedirect (EntityRedirect $redirect, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) | |
Saves the given EntityRedirect to some underlying storage mechanism. More... | |
deleteEntity (EntityId $entityId, $reason, User $user) | |
Deletes the given entity in some underlying storage mechanism. More... | |
userWasLastToEdit (User $user, EntityId $id, $lastRevId) | |
Check if no edits were made by other users since the given revision. More... | |
updateWatchlist (User $user, EntityId $id, $watch) | |
Watches or unwatches the entity. More... | |
isWatching (User $user, EntityId $id) | |
Determines whether the given user is watching the given item. More... | |
canCreateWithCustomId (EntityId $id) | |
Whether an entity with the given custom ID can exist. More... | |
Private Attributes | |
$entityStore | |
$stats | |
$timingPrefix | |
EntityStore that collects stats for edit save times.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::__construct | ( | EntityStore | $entityStore, |
StatsdDataFactoryInterface | $stats, | ||
string | $timingPrefix | ||
) |
EntityStore | $entityStore | |
StatsdDataFactoryInterface | $stats | |
string | $timingPrefix | Resulting metric will be: $timingPrefix.saveEntity.<entitytype> |
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::assignFreshId | ( | EntityDocument | $entity | ) |
Assigns a fresh ID to the given entity.
EntityDocument | $entity |
StorageException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::canCreateWithCustomId | ( | EntityId | $id | ) |
Whether an entity with the given custom ID can exist.
Implementations are not required to check if an entity with the given ID already exists. If this method returns true, this means that an entity with the given ID could be created (or already existed) at the time the method was called. There is no guarantee that this continues to be true after the method call returned. Callers must be careful to handle race conditions.
EntityId | $id |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::deleteEntity | ( | EntityId | $entityId, |
$reason, | |||
User | $user | ||
) |
Deletes the given entity in some underlying storage mechanism.
EntityId | $entityId | |
string | $reason | the reason for deletion |
User | $user |
StorageException | |
PermissionsError |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::isWatching | ( | User | $user, |
EntityId | $id | ||
) |
Determines whether the given user is watching the given item.
User | $user | |
EntityId | $id | the entity to watch |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::saveEntity | ( | EntityDocument | $entity, |
$summary, | |||
User | $user, | ||
$flags = 0 , |
|||
$baseRevId = false , |
|||
array | $tags = [] |
||
) |
Saves the given Entity to some underlying storage mechanism.
EntityDocument | $entity | the entity to save. |
string | $summary | the edit summary for the new revision. |
User | $user | the user to whom to attribute the edit |
int | $flags | EDIT_XXX flags, as defined for WikiPage::doEditContent. Additionally, the EntityContent::EDIT_XXX constants can be used. |
int | bool | $baseRevId | the revision ID $entity is based on. Saving should fail if $baseRevId is no longer the current revision. |
string[] | $tags | Change tags to add to the edit. Callers are responsible for permission checks (typically using ChangeTags::canAddTagsAccompanyingChange). |
StorageException | |
PermissionsError |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::saveRedirect | ( | EntityRedirect | $redirect, |
$summary, | |||
User | $user, | ||
$flags = 0 , |
|||
$baseRevId = false , |
|||
array | $tags = [] |
||
) |
Saves the given EntityRedirect to some underlying storage mechanism.
EntityRedirect | $redirect | the redirect to save. |
string | $summary | the edit summary for the new revision. |
User | $user | the user to whom to attribute the edit |
int | $flags | EDIT_XXX flags, as defined for WikiPage::doEditContent. |
int | bool | $baseRevId | the revision ID $entity is based on. Saving should fail if $baseRevId is no longer the current revision. |
string[] | $tags | Change tags to add to the edit. Callers are responsible for permission checks (typically using ChangeTags::canAddTagsAccompanyingChange). |
StorageException | |
PermissionsError |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::updateWatchlist | ( | User | $user, |
EntityId | $id, | ||
$watch | |||
) |
Watches or unwatches the entity.
User | $user | |
EntityId | $id | the entity to watch |
bool | $watch | whether to watch or unwatch the page. |
MWException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore::userWasLastToEdit | ( | User | $user, |
EntityId | $id, | ||
$lastRevId | |||
) |
Check if no edits were made by other users since the given revision.
This makes the assumption that revision ids are monotonically increasing.
User | $user | |
EntityId | $id | the entity to check |
int | $lastRevId | the revision to check from |
Implements Wikibase\Lib\Store\EntityStore.
|
private |
|
private |
|
private |