mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-09-13 18:59:25 +00:00
🎨 style: refresh topology visualization
This commit is contained in:
@@ -4,8 +4,6 @@ export interface ResourceMetrics {
|
||||
memoryUsage?: string;
|
||||
memoryUsagePercent?: number;
|
||||
}
|
||||
|
||||
/** Convert CPU nanoseconds (e.g. "123456789n") to millicores (e.g. "123m") */
|
||||
export function parseCpuUsage(cpuNano: string): string | undefined {
|
||||
const usageNano = Number.parseInt(cpuNano.replace("n", ""), 10);
|
||||
if (Number.isNaN(usageNano)) return undefined;
|
||||
@@ -24,8 +22,6 @@ export function calculateCpuPercent(cpuNano: string, capacityNano: string): numb
|
||||
|
||||
return Math.round((usageNano / capNano) * 100);
|
||||
}
|
||||
|
||||
/** Convert memory kibibytes (e.g. "1024Ki") to mebibytes (e.g. "1Mi") */
|
||||
export function parseMemoryUsage(memoryKi: string): string | undefined {
|
||||
const usageKi = Number.parseInt(memoryKi.replace("Ki", ""), 10);
|
||||
if (Number.isNaN(usageKi)) return undefined;
|
||||
@@ -44,8 +40,6 @@ export function calculateMemoryPercent(memoryKi: string, capacityKi: string): nu
|
||||
|
||||
return Math.round((usageKi / capKi) * 100);
|
||||
}
|
||||
|
||||
/** Parse raw K8s metrics into a standardized format with optional percentages */
|
||||
export function parseK8sMetrics(
|
||||
cpuUsage?: string,
|
||||
memoryUsage?: string,
|
||||
|
||||
@@ -23,8 +23,8 @@ export interface ResourceMetrics {
|
||||
export interface K8sNodeMetadata {
|
||||
node: K8sNodeSummary;
|
||||
podCount: number;
|
||||
serverPods: string[]; // Pod names of servers
|
||||
proxyPods: string[]; // Pod names of proxies
|
||||
serverPods: string[];
|
||||
proxyPods: string[];
|
||||
health: HealthStatus;
|
||||
metrics?: ResourceMetrics;
|
||||
}
|
||||
@@ -35,8 +35,8 @@ export interface ServerMetadata {
|
||||
readyPods: number;
|
||||
pods: PodInfo[];
|
||||
health: HealthStatus;
|
||||
connectedProxies: string[]; // IDs of reverse proxies pointing to this server
|
||||
k8sNodes: string[]; // Names of K8s nodes running this server's pods
|
||||
connectedProxies: string[];
|
||||
k8sNodes: string[];
|
||||
connectionInfo?: ConnectionInfo | null;
|
||||
metrics?: ResourceMetrics;
|
||||
}
|
||||
@@ -47,8 +47,8 @@ export interface ProxyMetadata {
|
||||
readyPods: number;
|
||||
pods: PodInfo[];
|
||||
health: HealthStatus;
|
||||
connectedServers: string[]; // IDs of servers this proxy routes to
|
||||
k8sNodes: string[]; // Names of K8s nodes running this proxy's pods
|
||||
connectedServers: string[];
|
||||
k8sNodes: string[];
|
||||
connectionInfo?: ConnectionInfo | null;
|
||||
metrics?: ResourceMetrics;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user