new stats to count resources
This commit is contained in:
parent
478a92a881
commit
4de148f783
1 changed files with 41 additions and 0 deletions
|
@ -109,6 +109,12 @@ class Stats
|
||||||
if ($value >= 1) {
|
if ($value >= 1) {
|
||||||
$this->statsd->increment($metric . $tags);
|
$this->statsd->increment($metric . $tags);
|
||||||
}
|
}
|
||||||
|
if($metric == $usersMetrics[0]) {
|
||||||
|
$this->statsd->increment('users.{scope}.count.total' . $tags);
|
||||||
|
}
|
||||||
|
if($metric == $usersMetrics[3]) {
|
||||||
|
$this->statsd->decrement('users.{scope}.count.total' . $tags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$dbMetrics = [
|
$dbMetrics = [
|
||||||
|
@ -131,6 +137,27 @@ class Stats
|
||||||
if ($value >= 1) {
|
if ($value >= 1) {
|
||||||
$dbTags = $tags . ",collectionId=" . ($this->params['collectionId'] ?? '') . ",databaseId=" . ($this->params['databaseId'] ?? '');
|
$dbTags = $tags . ",collectionId=" . ($this->params['collectionId'] ?? '') . ",databaseId=" . ($this->params['databaseId'] ?? '');
|
||||||
$this->statsd->increment($metric . $dbTags);
|
$this->statsd->increment($metric . $dbTags);
|
||||||
|
|
||||||
|
if($metric == $dbMetrics[0]) {
|
||||||
|
$this->statsd->increment('databases.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
|
if($metric == $dbMetrics[3]) {
|
||||||
|
$this->statsd->decrement('databases.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($metric == $dbMetrics[4]) {
|
||||||
|
$this->statsd->increment('collections.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
|
if($metric == $dbMetrics[7]) {
|
||||||
|
$this->statsd->decrement('collections.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($metric == $dbMetrics[8]) {
|
||||||
|
$this->statsd->increment('documents.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
|
if($metric == $dbMetrics[11]) {
|
||||||
|
$this->statsd->decrement('documents.{scope}.count.total' . $dbTags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +177,20 @@ class Stats
|
||||||
if ($value >= 1) {
|
if ($value >= 1) {
|
||||||
$storageTags = $tags . ",bucketId=" . ($this->params['bucketId'] ?? '');
|
$storageTags = $tags . ",bucketId=" . ($this->params['bucketId'] ?? '');
|
||||||
$this->statsd->increment($metric . $storageTags);
|
$this->statsd->increment($metric . $storageTags);
|
||||||
|
|
||||||
|
if($metric == $storageMertics[0]) {
|
||||||
|
$this->statsd->increment('buckets.{scope}.count.total' . $storageTags);
|
||||||
|
}
|
||||||
|
if($metric == $storageMertics[3]) {
|
||||||
|
$this->statsd->decrement('buckets.{scope}.count.total' . $storageTags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($metric == $storageMertics[4]) {
|
||||||
|
$this->statsd->increment('files.{scope}.count.total' . $storageTags);
|
||||||
|
}
|
||||||
|
if($metric == $storageMertics[7]) {
|
||||||
|
$this->statsd->decrement('files.{scope}.count.total' . $storageTags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue