1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

fix negative stats

This commit is contained in:
Damodar Lohani 2022-10-18 08:28:12 +00:00
parent 868e487a59
commit 5ff8ac46aa

View file

@ -155,7 +155,7 @@ class Stats
foreach ($storageMertics as $metric) {
$value = $this->params[$metric] ?? 0;
if ($value >= 1 || $value == -1) {
if ($value >= 1 || $value == -1 || $value < -1) {
$storageTags = $tags . ",bucketId=" . ($this->params['bucketId'] ?? '');
$this->statsd->count($metric . $storageTags, $value);
}
@ -188,11 +188,11 @@ class Stats
$deploymentSize = $this->params['deployment.{scope}.storage.size'] ?? 0;
$storageSize = $this->params['files.{scope}.storage.size'] ?? 0;
if ($deploymentSize + $storageSize > 0) {
if ($deploymentSize + $storageSize > 0 || $deploymentSize + $storageSize <= -1) {
$this->statsd->count('project.{scope}.storage.size' . $tags, $deploymentSize + $storageSize);
}
if ($deploymentSize > 0) {
if ($deploymentSize > 0 || $deploymentSize <= -1) {
$this->statsd->count('deployments.{scope}.storage.size' . $functionTags, $deploymentSize);
}