类 OshiUtil

java.lang.Object
com.tlcsdm.core.oshi.OshiUtil

public class OshiUtil extends Object
Oshi库封装的工具类,通过此工具类,可获取系统、硬件相关信息
 1、系统信息
 2、硬件信息
 

相关内容见: oshi

  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private static final oshi.hardware.HardwareAbstractionLayer
    硬件信息
    private static final oshi.software.os.OperatingSystem
    系统信息
    private static final oshi.SystemInfo
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static CpuInfo
    获取系统CPU 系统使用率、用户使用率、利用率等等 相关信息
    默认间隔1秒
    static CpuInfo
    getCpuInfo(long waitingTime)
    获取系统CPU 系统使用率、用户使用率、利用率等等 相关信息
    static oshi.software.os.OSProcess
    获取当前进程信息OSProcess
    static List<oshi.hardware.HWDiskStore>
    获取磁盘相关信息,可能有多个磁盘(包括可移动磁盘等)
    static oshi.hardware.HardwareAbstractionLayer
    获取硬件相关信息,包括内存、硬盘、网络设备、显示器、USB、声卡等
    static oshi.hardware.GlobalMemory
    获取内存相关信息,比如总内存、可用内存等
    static List<oshi.hardware.NetworkIF>
    获取网络相关信息,可能多块网卡
    static oshi.software.os.OperatingSystem
    获取操作系统相关信息,包括系统版本、文件系统、进程等
    static oshi.hardware.CentralProcessor
    获取CPU(处理器)相关信息,比如CPU负载等
    static oshi.hardware.Sensors
    获取传感器相关信息,例如CPU温度、风扇转速等,传感器可能有多个
    static oshi.hardware.ComputerSystem
    获取BIOS中计算机相关信息,比如序列号、固件版本等

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • systemInfo

      private static final oshi.SystemInfo systemInfo
    • hardware

      private static final oshi.hardware.HardwareAbstractionLayer hardware
      硬件信息
    • os

      private static final oshi.software.os.OperatingSystem os
      系统信息
  • 构造器详细资料

    • OshiUtil

      public OshiUtil()
  • 方法详细资料

    • getOs

      public static oshi.software.os.OperatingSystem getOs()
      获取操作系统相关信息,包括系统版本、文件系统、进程等
      返回:
      操作系统相关信息
    • getCurrentProcess

      public static oshi.software.os.OSProcess getCurrentProcess()
      获取当前进程信息OSProcess
      返回:
      进程信息 OSProcess
      从以下版本开始:
      5.7.12
    • getHardware

      public static oshi.hardware.HardwareAbstractionLayer getHardware()
      获取硬件相关信息,包括内存、硬盘、网络设备、显示器、USB、声卡等
      返回:
      硬件相关信息
    • getSystem

      public static oshi.hardware.ComputerSystem getSystem()
      获取BIOS中计算机相关信息,比如序列号、固件版本等
      返回:
      获取BIOS中计算机相关信息
    • getMemory

      public static oshi.hardware.GlobalMemory getMemory()
      获取内存相关信息,比如总内存、可用内存等
      返回:
      内存相关信息
    • getProcessor

      public static oshi.hardware.CentralProcessor getProcessor()
      获取CPU(处理器)相关信息,比如CPU负载等
      返回:
      CPU(处理器)相关信息
    • getSensors

      public static oshi.hardware.Sensors getSensors()
      获取传感器相关信息,例如CPU温度、风扇转速等,传感器可能有多个
      返回:
      传感器相关信息
    • getDiskStores

      public static List<oshi.hardware.HWDiskStore> getDiskStores()
      获取磁盘相关信息,可能有多个磁盘(包括可移动磁盘等)
      返回:
      磁盘相关信息
      从以下版本开始:
      5.3.6
    • getNetworkIFs

      public static List<oshi.hardware.NetworkIF> getNetworkIFs()
      获取网络相关信息,可能多块网卡
      返回:
      网络相关信息
      从以下版本开始:
      5.3.6
    • getCpuInfo

      public static CpuInfo getCpuInfo()
      获取系统CPU 系统使用率、用户使用率、利用率等等 相关信息
      默认间隔1秒
      返回:
      系统 CPU 使用率 等信息
    • getCpuInfo

      public static CpuInfo getCpuInfo(long waitingTime)
      获取系统CPU 系统使用率、用户使用率、利用率等等 相关信息
      参数:
      waitingTime - 设置等待时间,单位毫秒
      返回:
      系统 CPU 使用率 等信息