com.ruoyi.common.utils.Arith Java Examples

The following examples show how to use com.ruoyi.common.utils.Arith. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Server.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}
 
Example #2
Source File: Server.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}
 
Example #3
Source File: Server.java    From RuoYi-Vue with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}
 
Example #4
Source File: Jvm.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024), 2);
}
 
Example #5
Source File: Mem.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(used, total, 4), 100);
}
 
Example #6
Source File: Cpu.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.round(Arith.mul(total, 100), 2);
}
 
Example #7
Source File: Cpu.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getSys()
{
    return Arith.round(Arith.mul(sys / total, 100), 2);
}
 
Example #8
Source File: Cpu.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.round(Arith.mul(used / total, 100), 2);
}
 
Example #9
Source File: Cpu.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getWait()
{
    return Arith.round(Arith.mul(wait / total, 100), 2);
}
 
Example #10
Source File: Cpu.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.round(Arith.mul(free / total, 100), 2);
}
 
Example #11
Source File: Jvm.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024), 2);
}
 
Example #12
Source File: Jvm.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getMax()
{
    return Arith.div(max, (1024 * 1024), 2);
}
 
Example #13
Source File: Mem.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(used, (1024 * 1024 * 1024), 2);
}
 
Example #14
Source File: Jvm.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(total - free, (1024 * 1024), 2);
}
 
Example #15
Source File: Jvm.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(total - free, total, 4), 100);
}
 
Example #16
Source File: Mem.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024 * 1024), 2);
}
 
Example #17
Source File: Mem.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(used, (1024 * 1024 * 1024), 2);
}
 
Example #18
Source File: Mem.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024 * 1024), 2);
}
 
Example #19
Source File: Mem.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(used, total, 4), 100);
}
 
Example #20
Source File: Cpu.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.round(Arith.mul(total, 100), 2);
}
 
Example #21
Source File: Cpu.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getSys()
{
    return Arith.round(Arith.mul(sys / total, 100), 2);
}
 
Example #22
Source File: Cpu.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.round(Arith.mul(used / total, 100), 2);
}
 
Example #23
Source File: Cpu.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getWait()
{
    return Arith.round(Arith.mul(wait / total, 100), 2);
}
 
Example #24
Source File: Cpu.java    From ruoyiplus with MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.round(Arith.mul(free / total, 100), 2);
}
 
Example #25
Source File: Cpu.java    From supplierShop with MIT License 4 votes vote down vote up
public double getSys()
{
    return Arith.round(Arith.mul(sys / total, 100), 2);
}
 
Example #26
Source File: Jvm.java    From supplierShop with MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024), 2);
}
 
Example #27
Source File: Jvm.java    From supplierShop with MIT License 4 votes vote down vote up
public double getMax()
{
    return Arith.div(max, (1024 * 1024), 2);
}
 
Example #28
Source File: Jvm.java    From supplierShop with MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024), 2);
}
 
Example #29
Source File: Jvm.java    From supplierShop with MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(total - free, (1024 * 1024), 2);
}
 
Example #30
Source File: Jvm.java    From supplierShop with MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(total - free, total, 4), 100);
}