private long getNetworkMetricAsLong(NetworkMetric type) {
        networkStats.refresh();

        return switch (type) {
            case BYTES_SENT -> networkStats.bytesSent;
            case PACKETS_SENT -> networkStats.packetsSent;
            case BYTES_RECEIVED -> networkStats.bytesReceived;
            case PACKETS_RECEIVED -> networkStats.packetsReceived;
            default -> throw new IllegalStateException("Unknown NetworkMetrics: " + type.name());
        };
    }
ref https://github.com/jrask/micrometer-oshi-binder
@author intr3p1d
collector-monitor/src/main/java/com/navercorp/pinpoint/collector/monitor/micrometer/binder/NetworkMetricsBinder.java