美文网首页
Java(version:11) oshi(version:4.

Java(version:11) oshi(version:4.

作者: MicoCube | 来源:发表于2019-12-27 16:25 被阅读0次

    加入依赖

    <dependency>
                <groupId>com.github.oshi</groupId>
                <artifactId>oshi-core</artifactId>
                <version>4.2.1</version>
                <exclusions>
                    <exclusion>
                        <artifactId>jna-platform</artifactId>
                        <groupId>net.java.dev.jna</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jna</artifactId>
                        <groupId>net.java.dev.jna</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
    
            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
                <version>5.5.0</version>
            </dependency>
            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna-platform</artifactId>
                <version>5.5.0</version>
            </dependency>
    

    注意,jna的版本和oshi的版本一定要对上,怎么查版本对应?

    从这进去https://search.maven.org/artifact/com.github.oshi/oshi-core/
    查看oshi的pom文件,如果当前项目依赖了jna,那么一定要按照pom文件中的来,将之前的exclude,再重新dependency,就像我上面的依赖文件一样,我的是springboot项目,在依赖里有jna,所以先排除,再加入

    测试代码

    package com.coding.system;
    
    import static org.junit.Assert.assertFalse;
    
    import java.time.Instant;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;
    
    import org.junit.Test;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import oshi.PlatformEnum;
    import oshi.SystemInfo;
    import oshi.hardware.CentralProcessor;
    import oshi.hardware.CentralProcessor.TickType;
    import oshi.hardware.ComputerSystem;
    import oshi.hardware.Display;
    import oshi.hardware.GlobalMemory;
    import oshi.hardware.HWDiskStore;
    import oshi.hardware.HWPartition;
    import oshi.hardware.HardwareAbstractionLayer;
    import oshi.hardware.NetworkIF;
    import oshi.hardware.PhysicalMemory;
    import oshi.hardware.PowerSource;
    import oshi.hardware.Sensors;
    import oshi.hardware.SoundCard;
    import oshi.hardware.UsbDevice;
    import oshi.hardware.VirtualMemory;
    import oshi.software.os.FileSystem;
    import oshi.software.os.NetworkParams;
    import oshi.software.os.OSFileStore;
    import oshi.software.os.OSProcess;
    import oshi.software.os.OSService;
    import oshi.software.os.OperatingSystem;
    import oshi.software.os.OperatingSystem.ProcessSort;
    import oshi.util.FormatUtil;
    import oshi.util.Util;
    
    /**
     * A demonstration of access to many of OSHI's capabilities
     */
    public class SystemInfoTest {
    
        private static final Logger logger = LoggerFactory.getLogger(SystemInfoTest.class);
    
        static List<String> oshi = new ArrayList<>();
    
        /**
         * Test that this platform is implemented..
         */
        @Test
        public void testPlatformEnum() {
    
            assertFalse(PlatformEnum.UNKNOWN.equals(SystemInfo.getCurrentPlatformEnum()));
            // Exercise the main method
            main(null);
        }
    
        /**
         * The main method, demonstrating use of classes.
         *
         * @param args
         *            the arguments (unused)
         */
        public static void main(String[] args) {
            logger.info("Initializing System...");
            SystemInfo si = new SystemInfo();
    
            HardwareAbstractionLayer hal = si.getHardware();
            OperatingSystem os = si.getOperatingSystem();
    
            printOperatingSystem(os);
    
            logger.info("Checking computer system...");
            printComputerSystem(hal.getComputerSystem());
    
            logger.info("Checking Processor...");
            printProcessor(hal.getProcessor());
    
            logger.info("Checking Memory...");
            printMemory(hal.getMemory());
    
            logger.info("Checking CPU...");
            printCpu(hal.getProcessor());
    
            logger.info("Checking Processes...");
            printProcesses(os, hal.getMemory());
    
            logger.info("Checking Services...");
            printServices(os);
    
            logger.info("Checking Sensors...");
            printSensors(hal.getSensors());
    
            logger.info("Checking Power sources...");
            printPowerSources(hal.getPowerSources());
    
            logger.info("Checking Disks...");
            printDisks(hal.getDiskStores());
    
            logger.info("Checking File System...");
            printFileSystem(os.getFileSystem());
    
            logger.info("Checking Network interfaces...");
            printNetworkInterfaces(hal.getNetworkIFs());
    
            logger.info("Checking Network parameters...");
            printNetworkParameters(os.getNetworkParams());
    
            // hardware: displays
            logger.info("Checking Displays...");
            printDisplays(hal.getDisplays());
    
            // hardware: USB devices
            logger.info("Checking USB Devices...");
            printUsbDevices(hal.getUsbDevices(true));
    
            logger.info("Checking Sound Cards...");
            printSoundCards(hal.getSoundCards());
    
            StringBuilder output = new StringBuilder();
            for (int i = 0; i < oshi.size(); i++) {
                output.append(oshi.get(i));
                if (oshi.get(i) != null && !oshi.get(i).endsWith("\n")) {
                    output.append('\n');
                }
            }
            logger.info("Printing Operating System and Hardware Info:{}{}", '\n', output);
        }
    
        private static void printOperatingSystem(final OperatingSystem os) {
            oshi.add(String.valueOf(os));
            oshi.add("Booted: " + Instant.ofEpochSecond(os.getSystemBootTime()));
            oshi.add("Uptime: " + FormatUtil.formatElapsedSecs(os.getSystemUptime()));
            oshi.add("Running with" + (os.isElevated() ? "" : "out") + " elevated permissions.");
        }
    
        private static void printComputerSystem(final ComputerSystem computerSystem) {
            oshi.add("system: " + computerSystem.toString());
            oshi.add(" firmware: " + computerSystem.getFirmware().toString());
            oshi.add(" baseboard: " + computerSystem.getBaseboard().toString());
        }
    
        private static void printProcessor(CentralProcessor processor) {
            oshi.add(processor.toString());
        }
    
        private static void printMemory(GlobalMemory memory) {
            oshi.add("Memory: \n " + memory.toString());
            VirtualMemory vm = memory.getVirtualMemory();
            oshi.add("Swap: \n " + vm.toString());
            PhysicalMemory[] pmArray = memory.getPhysicalMemory();
            if (pmArray.length > 0) {
                oshi.add("Physical Memory: ");
                for (PhysicalMemory pm : pmArray) {
                    oshi.add(" " + pm.toString());
                }
            }
        }
    
        private static void printCpu(CentralProcessor processor) {
            oshi.add("Context Switches/Interrupts: " + processor.getContextSwitches() + " / " + processor.getInterrupts());
    
            long[] prevTicks = processor.getSystemCpuLoadTicks();
            long[][] prevProcTicks = processor.getProcessorCpuLoadTicks();
            oshi.add("CPU, IOWait, and IRQ ticks @ 0 sec:" + Arrays.toString(prevTicks));
            // Wait a second...
            Util.sleep(1000);
            long[] ticks = processor.getSystemCpuLoadTicks();
            oshi.add("CPU, IOWait, and IRQ ticks @ 1 sec:" + Arrays.toString(ticks));
            long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()];
            long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()];
            long sys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()];
            long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()];
            long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()];
            long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()];
            long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()];
            long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()];
            long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal;
    
            oshi.add(String.format(
                    "User: %.1f%% Nice: %.1f%% System: %.1f%% Idle: %.1f%% IOwait: %.1f%% IRQ: %.1f%% SoftIRQ: %.1f%% Steal: %.1f%%",
                    100d * user / totalCpu, 100d * nice / totalCpu, 100d * sys / totalCpu, 100d * idle / totalCpu,
                    100d * iowait / totalCpu, 100d * irq / totalCpu, 100d * softirq / totalCpu, 100d * steal / totalCpu));
            oshi.add(String.format("CPU load: %.1f%%", processor.getSystemCpuLoadBetweenTicks(prevTicks) * 100));
            double[] loadAverage = processor.getSystemLoadAverage(3);
            oshi.add("CPU load averages:" + (loadAverage[0] < 0 ? " N/A" : String.format(" %.2f", loadAverage[0]))
                    + (loadAverage[1] < 0 ? " N/A" : String.format(" %.2f", loadAverage[1]))
                    + (loadAverage[2] < 0 ? " N/A" : String.format(" %.2f", loadAverage[2])));
            // per core CPU
            StringBuilder procCpu = new StringBuilder("CPU load per processor:");
            double[] load = processor.getProcessorCpuLoadBetweenTicks(prevProcTicks);
            for (double avg : load) {
                procCpu.append(String.format(" %.1f%%", avg * 100));
            }
            oshi.add(procCpu.toString());
            long freq = processor.getProcessorIdentifier().getVendorFreq();
            if (freq > 0) {
                oshi.add("Vendor Frequency: " + FormatUtil.formatHertz(freq));
            }
            freq = processor.getMaxFreq();
            if (freq > 0) {
                oshi.add("Max Frequency: " + FormatUtil.formatHertz(freq));
            }
            long[] freqs = processor.getCurrentFreq();
            if (freqs[0] > 0) {
                StringBuilder sb = new StringBuilder("Current Frequencies: ");
                for (int i = 0; i < freqs.length; i++) {
                    if (i > 0) {
                        sb.append(", ");
                    }
                    sb.append(FormatUtil.formatHertz(freqs[i]));
                }
                oshi.add(sb.toString());
            }
        }
    
        private static void printProcesses(OperatingSystem os, GlobalMemory memory) {
            oshi.add("My PID: " + os.getProcessId() + " with affinity "
                    + Long.toBinaryString(os.getProcessAffinityMask(os.getProcessId())));
            oshi.add("Processes: " + os.getProcessCount() + ", Threads: " + os.getThreadCount());
            // Sort by highest CPU
            List<OSProcess> procs = Arrays.asList(os.getProcesses(5, ProcessSort.CPU));
    
            oshi.add("   PID  %CPU %MEM       VSZ       RSS Name");
            for (int i = 0; i < procs.size() && i < 5; i++) {
                OSProcess p = procs.get(i);
                oshi.add(String.format(" %5d %5.1f %4.1f %9s %9s %s", p.getProcessID(),
                        100d * (p.getKernelTime() + p.getUserTime()) / p.getUpTime(),
                        100d * p.getResidentSetSize() / memory.getTotal(), FormatUtil.formatBytes(p.getVirtualSize()),
                        FormatUtil.formatBytes(p.getResidentSetSize()), p.getName()));
            }
        }
    
        private static void printServices(OperatingSystem os) {
            oshi.add("Services: ");
            oshi.add("   PID   State   Name");
            // DO 5 each of running and stopped
            int i = 0;
            for (OSService s : os.getServices()) {
                if (s.getState().equals(OSService.State.RUNNING) && i++ < 5) {
                    oshi.add(String.format(" %5d  %7s  %s", s.getProcessID(), s.getState(), s.getName()));
                }
            }
            i = 0;
            for (OSService s : os.getServices()) {
                if (s.getState().equals(OSService.State.STOPPED) && i++ < 5) {
                    oshi.add(String.format(" %5d  %7s  %s", s.getProcessID(), s.getState(), s.getName()));
                }
            }
        }
    
        private static void printSensors(Sensors sensors) {
            oshi.add("Sensors: " + sensors.toString());
        }
    
        private static void printPowerSources(PowerSource[] powerSources) {
            StringBuilder sb = new StringBuilder("Power Sources: ");
            if (powerSources.length == 0) {
                sb.append("Unknown");
            }
            for (PowerSource powerSource : powerSources) {
                sb.append("\n ").append(powerSource.toString());
            }
            oshi.add(sb.toString());
        }
    
        private static void printDisks(HWDiskStore[] diskStores) {
            oshi.add("Disks:");
            for (HWDiskStore disk : diskStores) {
                oshi.add(" " + disk.toString());
    
                HWPartition[] partitions = disk.getPartitions();
                for (HWPartition part : partitions) {
                    oshi.add(" |-- " + part.toString());
                }
            }
    
        }
    
        private static void printFileSystem(FileSystem fileSystem) {
            oshi.add("File System:");
    
            oshi.add(String.format(" File Descriptors: %d/%d", fileSystem.getOpenFileDescriptors(),
                    fileSystem.getMaxFileDescriptors()));
    
            OSFileStore[] fsArray = fileSystem.getFileStores();
            for (OSFileStore fs : fsArray) {
                long usable = fs.getUsableSpace();
                long total = fs.getTotalSpace();
                oshi.add(String.format(
                        " %s (%s) [%s] %s of %s free (%.1f%%), %s of %s files free (%.1f%%) is %s "
                                + (fs.getLogicalVolume() != null && fs.getLogicalVolume().length() > 0 ? "[%s]" : "%s")
                                + " and is mounted at %s",
                        fs.getName(), fs.getDescription().isEmpty() ? "file system" : fs.getDescription(), fs.getType(),
                        FormatUtil.formatBytes(usable), FormatUtil.formatBytes(fs.getTotalSpace()), 100d * usable / total,
                        FormatUtil.formatValue(fs.getFreeInodes(), ""), FormatUtil.formatValue(fs.getTotalInodes(), ""),
                        100d * fs.getFreeInodes() / fs.getTotalInodes(), fs.getVolume(), fs.getLogicalVolume(),
                        fs.getMount()));
            }
        }
    
        private static void printNetworkInterfaces(NetworkIF[] networkIFs) {
            StringBuilder sb = new StringBuilder("Network Interfaces:");
            if (networkIFs.length == 0) {
                sb.append(" Unknown");
            }
            for (NetworkIF net : networkIFs) {
                sb.append("\n ").append(net.toString());
            }
            oshi.add(sb.toString());
        }
    
        private static void printNetworkParameters(NetworkParams networkParams) {
            oshi.add("Network parameters:\n " + networkParams.toString());
        }
    
        private static void printDisplays(Display[] displays) {
            oshi.add("Displays:");
            int i = 0;
            for (Display display : displays) {
                oshi.add(" Display " + i + ":");
                oshi.add(String.valueOf(display));
                i++;
            }
        }
    
        private static void printUsbDevices(UsbDevice[] usbDevices) {
            oshi.add("USB Devices:");
            for (UsbDevice usbDevice : usbDevices) {
                oshi.add(String.valueOf(usbDevice));
            }
        }
    
        private static void printSoundCards(SoundCard[] cards) {
            oshi.add("Sound Cards:");
            for (SoundCard card : cards) {
                oshi.add(" " + String.valueOf(card));
            }
        }
    }
    

    输出

    2019-12-27 16:16:29.859  INFO   --- [           main] com.coding.system.SystemInfoTest         : Initializing System...
    2019-12-27 16:16:30.093  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking computer system...
    2019-12-27 16:16:30.220  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Processor...
    2019-12-27 16:16:30.233  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Memory...
    2019-12-27 16:16:30.665  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking CPU...
    2019-12-27 16:16:31.680  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Processes...
    2019-12-27 16:16:32.160  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Services...
    2019-12-27 16:16:32.766  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Sensors...
    2019-12-27 16:16:32.805  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Power sources...
    2019-12-27 16:16:32.816  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Disks...
    2019-12-27 16:16:32.944  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking File System...
    2019-12-27 16:16:32.952  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Network interfaces...
    2019-12-27 16:16:33.006  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Network parameters...
    2019-12-27 16:16:33.242  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Displays...
    2019-12-27 16:16:33.246  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking USB Devices...
    2019-12-27 16:16:33.258  INFO   --- [           main] com.coding.system.SystemInfoTest         : Checking Sound Cards...
    2019-12-27 16:16:33.261  INFO   --- [           main] com.coding.system.SystemInfoTest         : Printing Operating System and Hardware Info:
    Apple macOS 10.13.1 (High Sierra) build 17B1003
    Booted: 2019-10-31T00:48:41Z
    Uptime: 57 days, 07:27:49
    Running without elevated permissions.
    system: manufacturer=Apple Inc., model=MacBookPro12,1, serial number=C02QP26DFVH3
     firmware: manufacturer=Apple Inc., name=boot.efi, description=EFI64, version=MBP121.88Z.0171.B00.1708080033, release date=08/08/2017
     baseboard: manufacturer=Apple Inc., model=Mac-E43C1C25D4880AD6, version=1.0, serial number=C02QP26DFVH3
    Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
     1 physical CPU package(s)
     2 physical CPU core(s)
     4 logical CPU(s)
    Identifier: Intel64 Family 6 Model 61 Stepping 4
    ProcessorID: BFEBFBFF000306D4
    Memory: 
     Available: 1.9 GiB/8 GiB
    Swap: 
     Used: 1.7 GiB/2 GiB
    Physical Memory: 
     Bank label: BANK 0/DIMM, Capacity: 4 GiB, Clock speed: 1.9 GHz, Manufacturer: 0x02FE, Memory type: DDR3
     Bank label: BANK 1/DIMM, Capacity: 4 GiB, Clock speed: 1.9 GHz, Manufacturer: 0x02FE, Memory type: DDR3
    Context Switches/Interrupts: 73397 / 476922
    CPU, IOWait, and IRQ ticks @ 0 sec:[28831132, 0, 27241642, 433697463, 0, 0, 0, 0]
    CPU, IOWait, and IRQ ticks @ 1 sec:[28831317, 0, 27241676, 433697643, 0, 0, 0, 0]
    User: 46.4% Nice: 0.0% System: 8.5% Idle: 45.1% IOwait: 0.0% IRQ: 0.0% SoftIRQ: 0.0% Steal: 0.0%
    CPU load: 54.9%
    CPU load averages: 5.26 4.79 4.69
    CPU load per processor: 73.0% 38.0% 69.0% 39.4%
    Vendor Frequency: 2.7 GHz
    Max Frequency: 2.7 GHz
    Current Frequencies: 2.7 GHz, 2.7 GHz, 2.7 GHz, 2.7 GHz
    My PID: 66848 with affinity 1111
    Processes: 341, Threads: 930
       PID  %CPU %MEM       VSZ       RSS Name
     66847 137.9  1.8   6.3 GiB 148.6 MiB java
     66848  90.8  1.1   7.6 GiB  92.1 MiB java
     64210   4.1  0.3   4.5 GiB  28.3 MiB Citrix Viewer
     66067   2.6  1.5   6.3 GiB 121.7 MiB java
     64673   1.8  0.7   4.9 GiB  57.5 MiB Google Chrome Helper (Renderer)
    Services: 
       PID   State   Name
       101  RUNNING  loginwindow
       272  RUNNING  cfprefsd
       273  RUNNING  UserEventAgent
       275  RUNNING  distnoted
       277  RUNNING  CommCenter
         0  STOPPED  com.apple.mdworker.shared
         0  STOPPED  com.apple.parentalcontrols.check
         0  STOPPED  com.apple.AOSHeartbeat
         0  STOPPED  com.apple.icloud.findmydeviced.findmydevice-user-agent
         0  STOPPED  com.apple.powerchime
    Sensors: CPU Temperature=67.375°C, Fan Speeds=[1302], CPU Voltage=0.0
    Power Sources: 
     Name: InternalBattery-0, Device Name: bq20z451,
     RemainingCapacityPercent: 100.0%, Time Remaining: Charging, Time Remaining Instant: 0:00,
     Power Usage Rate: 0.0mW, Voltage: 12.823V, Amperage: 0.0mA,
     Power OnLine: true, Charging: false, Discharging: true,
     Capacity Units: MAH, Current Capacity: 5427, Max Capacity: 5427, Design Capacity: 6559,
     Cycle Count: 283, Chemistry: unknown, Manufacture Date: 2015-10-20, Manufacturer: DP,
     SerialNumber: C01543209WWFY5QBK, Temperature: 30.54°C
    Disks:
     disk0: (model: APPLE SSD SM0128G - S/N: S29BNYAGA77268) size: 121.3 GB, reads: 17906663 (346.0 GiB), writes: 8108128 (194.4 GiB), xfer: 7368247
     |-- disk0s1: EFI (EFI System Partition) Maj:Min=1:1, size: 209.7 MB
     |-- disk0s2: Untitled 2 (Untitled 2) Maj:Min=1:2, size: 121.1 GB
     disk1: (model: APPLE SSD SM0128G - S/N: S29BNYAGA77268) size: 121.1 GB, reads: ? (?), writes: ? (?), xfer: ?
     |-- disk1s1: MicoCube (MicoCube) Maj:Min=1:4, size: 121.1 GB @ /
     |-- disk1s2: Preboot (Preboot) Maj:Min=1:6, size: 121.1 GB
     |-- disk1s3: Recovery (Recovery) Maj:Min=1:7, size: 121.1 GB
     |-- disk1s4: VM (VM) Maj:Min=1:5, size: 121.1 GB @ /private/var/vm
     disk2: (model: Disk Image - S/N: ) size: 16.5 MB, reads: 208 (15.8 MiB), writes: 0 (0 bytes), xfer: 4545
     |-- disk2s1: Apple (Apple) Maj:Min=1:9, size: 32.3 KB
     |-- disk2s2: Flash Player (DiscRecording 9.0.3d5) Maj:Min=1:10, size: 16.4 MB
     disk3: (model: Disk Image - S/N: ) size: 16.5 MB, reads: 182 (15.8 MiB), writes: 0 (0 bytes), xfer: 3054
     |-- disk3s1: Apple (Apple) Maj:Min=1:12, size: 32.3 KB
     |-- disk3s2: Flash Player (DiscRecording 9.0.3d5) Maj:Min=1:13, size: 16.4 MB
     disk4: (model: Disk Image - S/N: ) size: 23.6 MB, reads: 120 (22.4 MiB), writes: 0 (0 bytes), xfer: 10467
     |-- disk4s1: Apple (Apple) Maj:Min=1:16, size: 32.3 KB
     |-- disk4s2: Flash Player (DiscRecording 9.0.3d5) Maj:Min=1:15, size: 23.5 MB
    File System:
     File Descriptors: 4855/12288
     MicoCube (Volume) [apfs] 44.2 GiB of 112.8 GiB free (39.2%), 9.2 E of 9.2 E files free (100.0%) is /dev/disk1s1  and is mounted at /
     VM (Volume) [apfs] 44.2 GiB of 112.8 GiB free (39.2%), 9.2 E of 9.2 E files free (100.0%) is /dev/disk1s4  and is mounted at /private/var/vm
    Network Interfaces:
     Name: awdl0 (awdl0)
      MAC Address: a6:5f:9c:4d:ad:2a
      MTU: 1484, Speed: 10000000
      IPv4: []
      IPv6: [fe80:0:0:0:a45f:9cff:fe4d:ad2a]
      Traffic: received 58 packets/10 KiB (0 err); transmitted 242 packets/56 KiB (0 err)
     Name: en7 (en7)
      MAC Address: 30:b4:9e:86:c4:d7
      MTU: 1500, Speed: 100000000
      IPv4: [10.97.163.175]
      IPv6: [fe80:0:0:0:84b:f692:cb4e:5ac5]
      Traffic: received 5253022 packets/542.4 MiB (0 err); transmitted 707362 packets/49.1 MiB (0 err)
     Name: en0 (en0)
      MAC Address: ac:bc:32:c1:f2:81
      MTU: 1500, Speed: 304200000
      IPv4: [10.103.253.239]
      IPv6: [fe80:0:0:0:1a:637b:34ab:478d]
      Traffic: received 818482 packets/692.0 MiB (0 err); transmitted 745529 packets/66.7 MiB (0 err)
    Network parameters:
     Host name: micodeMacBook-Pro.local, Domain name: , DNS servers: [10.100.9.3], IPv4 Gateway: 10.103.253.1, IPv6 Gateway: fe80::
    Displays:
     Display 0:
      Manuf. ID=A, Product ID=a02a, Digital, Serial=00000000, ManufDate=3/2014, EDID v1.4
      29 x 18 cm (11.4 x 7.1 in)
      Preferred Timing: Clock 268MHz, Active Pixels 2560x1600 
      Monitor Name: Color LCD
      Preferred Timing: Clock 0MHz, Active Pixels 0x0 
      Preferred Timing: Clock 0MHz, Active Pixels 0x0 
    USB Devices:
     AppleUSBXHCI
     |-- AppleUSBXHCI Root Hub Simulation (Apple Inc.)
         |-- AirPod Case (Apple Inc.) [s/n: GFGXGZ1RH8TT]
         |-- Bluetooth USB Host Controller (Broadcom Corp.)
         |-- USB 10/100 LAN (Realtek) [s/n: 30B49E86C4D7]
    Sound Cards:
     SoundCard@1838ccb8 [kernelVersion=AppleHDAController 1.7.2a1, name=Apple Inc., codec=AppleHDACodec]
    

    相关文章

      网友评论

          本文标题:Java(version:11) oshi(version:4.

          本文链接:https://www.haomeiwen.com/subject/atpdoctx.html