Java Code Examples for com.ruoyi.common.utils.Arith

The following examples show how to use com.ruoyi.common.utils.Arith. These examples are extracted from open source projects. 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 Project: supplierShop   Source File: Server.java    License: 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 Project: RuoYi-Vue   Source File: Server.java    License: 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 Project: ruoyiplus   Source File: Server.java    License: 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 Project: supplierShop   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024), 2);
}
 
Example 5
Source Project: supplierShop   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getMax()
{
    return Arith.div(max, (1024 * 1024), 2);
}
 
Example 6
Source Project: supplierShop   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024), 2);
}
 
Example 7
Source Project: supplierShop   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(total - free, (1024 * 1024), 2);
}
 
Example 8
Source Project: supplierShop   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(total - free, total, 4), 100);
}
 
Example 9
Source Project: supplierShop   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024 * 1024), 2);
}
 
Example 10
Source Project: supplierShop   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(used, (1024 * 1024 * 1024), 2);
}
 
Example 11
Source Project: supplierShop   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024 * 1024), 2);
}
 
Example 12
Source Project: supplierShop   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(used, total, 4), 100);
}
 
Example 13
Source Project: supplierShop   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.round(Arith.mul(total, 100), 2);
}
 
Example 14
Source Project: supplierShop   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getSys()
{
    return Arith.round(Arith.mul(sys / total, 100), 2);
}
 
Example 15
Source Project: supplierShop   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.round(Arith.mul(used / total, 100), 2);
}
 
Example 16
Source Project: supplierShop   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getWait()
{
    return Arith.round(Arith.mul(wait / total, 100), 2);
}
 
Example 17
Source Project: supplierShop   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.round(Arith.mul(free / total, 100), 2);
}
 
Example 18
Source Project: RuoYi-Vue   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024), 2);
}
 
Example 19
Source Project: RuoYi-Vue   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getMax()
{
    return Arith.div(max, (1024 * 1024), 2);
}
 
Example 20
Source Project: RuoYi-Vue   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024), 2);
}
 
Example 21
Source Project: RuoYi-Vue   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(total - free, (1024 * 1024), 2);
}
 
Example 22
Source Project: RuoYi-Vue   Source File: Jvm.java    License: MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(total - free, total, 4), 100);
}
 
Example 23
Source Project: RuoYi-Vue   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.div(total, (1024 * 1024 * 1024), 2);
}
 
Example 24
Source Project: RuoYi-Vue   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.div(used, (1024 * 1024 * 1024), 2);
}
 
Example 25
Source Project: RuoYi-Vue   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getFree()
{
    return Arith.div(free, (1024 * 1024 * 1024), 2);
}
 
Example 26
Source Project: RuoYi-Vue   Source File: Mem.java    License: MIT License 4 votes vote down vote up
public double getUsage()
{
    return Arith.mul(Arith.div(used, total, 4), 100);
}
 
Example 27
Source Project: RuoYi-Vue   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getTotal()
{
    return Arith.round(Arith.mul(total, 100), 2);
}
 
Example 28
Source Project: RuoYi-Vue   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getSys()
{
    return Arith.round(Arith.mul(sys / total, 100), 2);
}
 
Example 29
Source Project: RuoYi-Vue   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getUsed()
{
    return Arith.round(Arith.mul(used / total, 100), 2);
}
 
Example 30
Source Project: RuoYi-Vue   Source File: Cpu.java    License: MIT License 4 votes vote down vote up
public double getWait()
{
    return Arith.round(Arith.mul(wait / total, 100), 2);
}