diff --git a/AppImage/components/network-metrics.tsx b/AppImage/components/network-metrics.tsx index 3b02a6e..e1a6465 100644 --- a/AppImage/components/network-metrics.tsx +++ b/AppImage/components/network-metrics.tsx @@ -191,35 +191,6 @@ export function NetworkMetrics() { ) } - const calculateInterfaceTraffic = (interfaceName: string) => { - if (!interfaceHistoricalData?.data) { - return { received: 0, sent: 0 } - } - - let totalReceived = 0 - let totalSent = 0 - - // Sum up the traffic from RRD data - for (const point of interfaceHistoricalData.data) { - const netinKey = `netin:${interfaceName}` - const netoutKey = `netout:${interfaceName}` - - if (point[netinKey] !== null && point[netinKey] !== undefined) { - // RRD data is in bytes/second, multiply by time interval to get total bytes - // Assuming 1 minute intervals for most timeframes - const interval = 60 // seconds - totalReceived += point[netinKey] * interval - } - - if (point[netoutKey] !== null && point[netoutKey] !== undefined) { - const interval = 60 - totalSent += point[netoutKey] * interval - } - } - - return { received: totalReceived, sent: totalSent } - } - const trafficInFormatted = formatStorage(networkTotals.received * 1024 * 1024 * 1024) // Convert GB to bytes const trafficOutFormatted = formatStorage(networkTotals.sent * 1024 * 1024 * 1024) const packetsRecvK = networkData.traffic.packets_recv ? (networkData.traffic.packets_recv / 1000).toFixed(0) : "0" @@ -387,7 +358,6 @@ export function NetworkMetrics() {