feat: init metrics

This commit is contained in:
Andras Bacsai
2024-05-09 13:25:18 +02:00
parent b5bef98a9b
commit 58601db5ef
3 changed files with 97 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ class Logs extends Component
public $query;
public $status;
public $serviceSubType;
public $cpu;
public function loadContainers($server_id)
{
try {
@@ -49,6 +49,14 @@ class Logs extends Component
return handleError($e, $this);
}
}
public function loadMetrics()
{
return;
$server = data_get($this->resource, 'destination.server');
if ($server->isFunctional()) {
$this->cpu = $server->getMetrics();
}
}
public function mount()
{
try {
@@ -95,6 +103,7 @@ class Logs extends Component
}
}
$this->containers = $this->containers->sort();
$this->loadMetrics();
} catch (\Exception $e) {
return handleError($e, $this);
}