mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-06 05:58:14 -04:00
Add a per-server Analytics page scoped to that host, move traffic settings out of Sentinel, and put metrics settings on Charts. Surface 4xx/5xx on path rows and restyle deployment logs.
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Data\Traffic;
|
|
|
|
use Spatie\LaravelData\Data;
|
|
|
|
class TrafficPathData extends Data
|
|
{
|
|
public function __construct(
|
|
public string $path,
|
|
public int $requests,
|
|
public int $bytesOut,
|
|
public int $s4xx,
|
|
public int $s5xx,
|
|
public float $p50,
|
|
public float $p95,
|
|
// Owning app key (Sentinel returns this per path row so the UI can show the
|
|
// domain). Empty on older Sentinel builds that predate the field.
|
|
public string $app = '',
|
|
) {}
|
|
|
|
public static function fromSentinel(array $row): self
|
|
{
|
|
return new self(
|
|
path: (string) data_get($row, 'path', ''),
|
|
requests: (int) data_get($row, 'requests', 0),
|
|
bytesOut: (int) data_get($row, 'bytes_out', 0),
|
|
s4xx: (int) data_get($row, 's4xx', 0),
|
|
s5xx: (int) data_get($row, 's5xx', 0),
|
|
p50: (float) data_get($row, 'p50', 0.0),
|
|
p95: (float) data_get($row, 'p95', 0.0),
|
|
app: (string) data_get($row, 'app', ''),
|
|
);
|
|
}
|
|
}
|