diff --git a/apps/hub/src/domains/game/components/game-matchmaker/game-matchmaker-lobby-details-panel.tsx b/apps/hub/src/domains/game/components/game-matchmaker/game-matchmaker-lobby-details-panel.tsx index a08aff44..779be0fd 100644 --- a/apps/hub/src/domains/game/components/game-matchmaker/game-matchmaker-lobby-details-panel.tsx +++ b/apps/hub/src/domains/game/components/game-matchmaker/game-matchmaker-lobby-details-panel.tsx @@ -88,7 +88,7 @@ export function GameMatchmakerLobbyDetailsPanel({ Output Error {isLive && metrics ? ( - Stats + Monitor ) : null} diff --git a/apps/hub/src/domains/game/components/game-matchmaker/lobby-cpu-stats.tsx b/apps/hub/src/domains/game/components/game-matchmaker/lobby-cpu-stats.tsx index 47d58199..bb196d2e 100644 --- a/apps/hub/src/domains/game/components/game-matchmaker/lobby-cpu-stats.tsx +++ b/apps/hub/src/domains/game/components/game-matchmaker/lobby-cpu-stats.tsx @@ -49,10 +49,7 @@ export function LobbyCPUStats({ cpu, metricsAt, syncId }: LobbyCPUStatsProps) { { - return [0, Math.ceil(dataMax * 100) / 100]; - }} + domain={[0, 1]} tickFormatter={(value) => `${value * 100}%`} /> { - return [0, allocatedMemory || dataMax]; - }} - tickFormatter={(value) => `${filesize(value)}`} + domain={[0, max]} + tickFormatter={(value) => `${Math.ceil((value / max) * 100)}%`} /> } diff --git a/apps/hub/src/domains/game/components/game-matchmaker/lobby-metrics.tsx b/apps/hub/src/domains/game/components/game-matchmaker/lobby-metrics.tsx index a086d526..63d25344 100644 --- a/apps/hub/src/domains/game/components/game-matchmaker/lobby-metrics.tsx +++ b/apps/hub/src/domains/game/components/game-matchmaker/lobby-metrics.tsx @@ -14,7 +14,8 @@ export function LobbyMetrics({ const currentMemory = memory[memory.length - 1]; const memoryPercentage = (currentMemory / (allocatedMemory || 1)) * 100; - const cpuPercentage = cpu[cpu.length - 1] * 100; + const cpuPercentage = cpu[cpu.length - 1]; + const maxMemory = allocatedMemory || Math.max(...memory); return ( - {filesize(currentMemory)} / {filesize(allocatedMemory || 1)} ( + {filesize(currentMemory)} / {filesize(maxMemory)} ( {memoryPercentage.toFixed(2)}%) > } @@ -36,7 +37,7 @@ export function LobbyMetrics({ trigger={ CPU - + } content={<>{cpuPercentage.toFixed(2)}%>} diff --git a/apps/hub/src/domains/game/components/game-matchmaker/lobby-stats.tsx b/apps/hub/src/domains/game/components/game-matchmaker/lobby-stats.tsx index 2ff911b2..3dd6991a 100644 --- a/apps/hub/src/domains/game/components/game-matchmaker/lobby-stats.tsx +++ b/apps/hub/src/domains/game/components/game-matchmaker/lobby-stats.tsx @@ -27,22 +27,28 @@ export function LobbyStats({ - Memory Usage + Memory Usage - - + + {memoryPercentage.toFixed(2)}% - + {filesize(memory[memory.length - 1])} {" "} @@ -54,11 +60,17 @@ export function LobbyStats({ - CPU Usage + CPU Usage - - + + {cpuPercentage.toFixed(2)}% diff --git a/packages/components/src/ui/chart.tsx b/packages/components/src/ui/chart.tsx index 8bd39cfb..094bf336 100644 --- a/packages/components/src/ui/chart.tsx +++ b/packages/components/src/ui/chart.tsx @@ -145,7 +145,6 @@ const ChartTooltipContent = React.forwardRef< const key = `${labelKey || item.dataKey || item.name || "value"}`; const itemConfig = getPayloadConfigFromPayload(config, item, key); - console.log({ config, item, key }, itemConfig); const value = !labelKey && typeof label === "string" ? config[label as keyof typeof config]?.label || label
Memory Usage
+
{filesize(memory[memory.length - 1])} {" "} @@ -54,11 +60,17 @@ export function LobbyStats({
CPU Usage