mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 16:10:40 +05:30
Сбор метрик о работе воркера
This commit is contained in:
parent
6f7fcf9e44
commit
0fee23ac86
@ -32,11 +32,14 @@ class AccountQueueController extends AmqpController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function routeUsernameChanged(UsernameChanged $body): bool {
|
public function routeUsernameChanged(UsernameChanged $body): bool {
|
||||||
|
Yii::$app->statsd->inc('worker.account.usernameChanged.attempt');
|
||||||
$mojangApi = $this->createMojangApi();
|
$mojangApi = $this->createMojangApi();
|
||||||
try {
|
try {
|
||||||
$response = $mojangApi->usernameToUUID($body->newUsername);
|
$response = $mojangApi->usernameToUUID($body->newUsername);
|
||||||
|
Yii::$app->statsd->inc('worker.account.usernameChanged.found');
|
||||||
} catch (NoContentException $e) {
|
} catch (NoContentException $e) {
|
||||||
$response = false;
|
$response = false;
|
||||||
|
Yii::$app->statsd->inc('worker.account.usernameChanged.not_found');
|
||||||
} catch (RequestException $e) {
|
} catch (RequestException $e) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user