當前位置: 首頁>>代碼示例>>Java>>正文


Java Sigar.FIELD_NOTIMPL屬性代碼示例

本文整理匯總了Java中org.hyperic.sigar.Sigar.FIELD_NOTIMPL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Sigar.FIELD_NOTIMPL屬性的具體用法?Java Sigar.FIELD_NOTIMPL怎麽用?Java Sigar.FIELD_NOTIMPL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.hyperic.sigar.Sigar的用法示例。


在下文中一共展示了Sigar.FIELD_NOTIMPL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: output

@Override
public void output(String[] args) throws SigarException {
    org.hyperic.sigar.CpuInfo[] infos = this.sigar.getCpuInfoList();
    org.hyperic.sigar.CpuInfo info = infos[0];
    long cacheSize = info.getCacheSize();
    try {
        bos.write(("== MACHINE INFORMATION ==\n").getBytes());
        bos.write(("Vendor........." + info.getVendor() + "\n").getBytes());
        bos.write(("Model.........." + info.getModel() + "\n").getBytes());
        bos.write(("Mhz............" + info.getMhz() + "\n").getBytes());
        bos.write(("Total CPUs....." + info.getTotalCores() + "\n").getBytes());
        if ((info.getTotalCores() != info.getTotalSockets())
                || (info.getCoresPerSocket() > info.getTotalCores())) {
            bos.write(("Physical CPUs.." + info.getTotalSockets() + "\n").getBytes());
            bos.write(("Cores per CPU.." + info.getCoresPerSocket() + "\n").getBytes());
        }

        if (cacheSize != Sigar.FIELD_NOTIMPL) {
            bos.write(("Cache size....." + cacheSize + "\n").getBytes());
        }
    } catch(Exception ex) {
        System.out.println("[CF LOG] Error retrieving system stats");
    }
}
 
開發者ID:OneSourceConsult,項目名稱:JavaProfiling-tool,代碼行數:24,代碼來源:CpuInfo.java

示例2: output

public void output(String[] args) throws SigarException {
    org.hyperic.sigar.CpuInfo[] infos =
        this.sigar.getCpuInfoList();

    CpuPerc[] cpus =
        this.sigar.getCpuPercList();

    org.hyperic.sigar.CpuInfo info = infos[0];
    long cacheSize = info.getCacheSize();
    println("Vendor........." + info.getVendor());
    println("Model.........." + info.getModel());
    println("Mhz............" + info.getMhz());
    println("Total CPUs....." + info.getTotalCores());
    if ((info.getTotalCores() != info.getTotalSockets()) ||
        (info.getCoresPerSocket() > info.getTotalCores()))
    {
        println("Physical CPUs.." + info.getTotalSockets());
        println("Cores per CPU.." + info.getCoresPerSocket());
    }

    if (cacheSize != Sigar.FIELD_NOTIMPL) {
        println("Cache size...." + cacheSize);
    }
    println("");

    if (!this.displayTimes) {
        return;
    }

    for (int i=0; i<cpus.length; i++) {
        println("CPU " + i + ".........");
        output(cpus[i]);
    }

    println("Totals........");
    output(this.sigar.getCpuPerc());
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:37,代碼來源:CpuInfo.java

示例3: outputDisk

public void outputDisk(String name) throws SigarException {
    DiskUsage disk =
        this.sigar.getDiskUsage(name);

    ArrayList items = new ArrayList();
    printHeader();
    items.add(name);
    items.add("-");
    items.add(String.valueOf(disk.getReads()));
    items.add(String.valueOf(disk.getWrites()));

    if (disk.getReadBytes() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
        items.add("-");
    }
    else {
        items.add(Sigar.formatSize(disk.getReadBytes()));
        items.add(Sigar.formatSize(disk.getWriteBytes()));
    }

    if (disk.getQueue() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
    }
    else {
        items.add(svctm(disk.getQueue()));
    }

    if (disk.getServiceTime() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
    }
    else {
        items.add(svctm(disk.getServiceTime()));
    }

    printf(items);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:36,代碼來源:Iostat.java

示例4: output

public void output(FileSystem fs) throws SigarException {
    FileSystemUsage usage =
        this.sigar.getFileSystemUsage(fs.getDirName());

    ArrayList items = new ArrayList();

    items.add(fs.getDevName());
    items.add(fs.getDirName());
    items.add(String.valueOf(usage.getDiskReads()));
    items.add(String.valueOf(usage.getDiskWrites()));

    if (usage.getDiskReadBytes() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
        items.add("-");
    }
    else {
        items.add(Sigar.formatSize(usage.getDiskReadBytes()));
        items.add(Sigar.formatSize(usage.getDiskWriteBytes()));
    }

    if (usage.getDiskQueue() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
    }
    else {
        items.add(svctm(usage.getDiskQueue()));
    }
    if (usage.getDiskServiceTime() == Sigar.FIELD_NOTIMPL) {
        items.add("-");
    }
    else {
        items.add(svctm(usage.getDiskServiceTime()));
    }

    printf(items);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:35,代碼來源:Iostat.java


注:本文中的org.hyperic.sigar.Sigar.FIELD_NOTIMPL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。