add data retention to the metrics

This commit is contained in:
Saeed Vaziry
2024-04-13 22:38:27 +02:00
parent ddacc32e64
commit 52d195710b
18 changed files with 346 additions and 140 deletions

View File

@ -46,13 +46,13 @@ private function metrics(
->select(
[
DB::raw('created_at as date'),
DB::raw('AVG(load) as load'),
DB::raw('AVG(memory_total) as memory_total'),
DB::raw('AVG(memory_used) as memory_used'),
DB::raw('AVG(memory_free) as memory_free'),
DB::raw('AVG(disk_total) as disk_total'),
DB::raw('AVG(disk_used) as disk_used'),
DB::raw('AVG(disk_free) as disk_free'),
DB::raw('ROUND(AVG(load), 2) as load'),
DB::raw('ROUND(AVG(memory_total), 2) as memory_total'),
DB::raw('ROUND(AVG(memory_used), 2) as memory_used'),
DB::raw('ROUND(AVG(memory_free), 2) as memory_free'),
DB::raw('ROUND(AVG(disk_total), 2) as disk_total'),
DB::raw('ROUND(AVG(disk_used), 2) as disk_used'),
DB::raw('ROUND(AVG(disk_free), 2) as disk_free'),
$interval,
],
)