- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我已经下载了 Sigar API ( http://support.hyperic.com/display/SIGAR/Home) 并想在项目中使用它来获取有关正在运行的不同进程的信息。
我的问题是我无法真正找到一些有用的代码片段来学习,而且他们网站上的 javadoc 也没有太大帮助,因为我不知道我应该寻找什么。
你知道我在哪里可以找到更多信息吗?
最佳答案
要查找 pid
(查找有关特定进程的信息所需的),您可以使用 ProcessFinder
。查找单个进程 pid 的方法是 findSingleProcess(String expression)
。示例:
Sigar sigar=new Sigar();
ProcessFinder find=new ProcessFinder(sigar);
long pid=find.findSingleProcess("Exe.Name.ct=explorer");
ProcMem memory=new ProcMem();
memory.gather(sigar, pid);
System.out.println(Long.toString(memory.getSize()));
表达式语法是这样的:
Class.Attribute.operator=value
地点:
Class is the name of the Sigar class minus the Proc prefix.
Attribute is an attribute of the given Class, index into an array or key in a Map class.
operator is one of the following for String values:
eq - Equal to value
ne - Not Equal to value
ew - Ends with value
sw - Starts with value
ct - Contains value (substring)
re - Regular expression value matches
operator is one of the following for numeric values:
eq - Equal to value
ne - Not Equal to value
gt - Greater than value
ge - Greater than or equal value
lt - Less than value
le - Less than or equal value
关于java - JAVA 的 Sigar API(需要指南),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12511956/
我是 Sigar 的新手,我正在尝试使用 Sigar API 来收集 CPU 使用率。 但是 Sigar 抛出了这个: org.hyperic.sigar.SigarPermissionDeniedE
我正在使用 a Hyperic SIGAR库作为我的安装程序中的第三方库。 我的安装程序将所有第三个 lib 文件解压到 %TEMP%\\user 文件夹。 在英语操作系统上一切正常,但是当我尝试在西
我的测试程序的依赖项是 org.fusesource.sigar,我还在我的类路径中添加了 sigar-1.6.4.jar。我知道将 sigar-amd64-winnt.dll 添加到我的类路径可能会
我是 Sigar 的新手。我想运行一个简单的测试来了解如何监控我的系统。 我添加了 sigar-1.6.4 和 log4j 作为外部库,但是当我运行它时,我遇到了这个错误: 线程“main”中的异常
import java.io.IOException; import org.hyperic.sigar.*; public class SigarDemo { public static void
我想开发一个网络应用程序使用 SIGAR jar 概念来获取信息关于网络机器就像是对网络应用程序的监控。但我对SIGAR了解不多请任何人帮助我了解SIGAR并且真的是 SIGAR 可以获取信息关于网络
Closed. This question does not meet Stack Overflow guidelines 。它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 Stack Ov
我正在使用最新的 IntelliJ IDEA ,并且 SIGAR.jar 已使用菜单中的外部库选项添加到我的项目中。虽然 IDE 看起来一切都很好,但当我尝试运行插件时它显示错误。打印出的错误是:ja
libhyperic-sigar-java: (System Information Gatherer And Reporter - Java bindings) 我知道如何在ubuntu中安装“li
试图运行 SIGAR快速获得许多硬件指标样本,我看到了这种行为: val sig: Sigar = new Sigar() val steady_cpu: Double = (for (i <- 1
我一直在尝试使用 Sigar library 来获取进程 CPU 使用情况但我总是得到 0 值,即使它应该更高。 我每秒都会在计时器上执行此操作: Sigar sigar = new Sigar();
我正在配置为单个本地集群的计算机上部署 Storm 拓扑。我已将 conf/storm.yaml 配置为使用 storm.scheduler: "org.apache.storm.scheduler.
由于他们的 wiki 或 Github 上没有说明,这就是我尝试过的: 克隆 the git repository 制作 运行examples/cpuinfo.c: cd 示例/ gcc -Wall
我在将 Sigar 与 Maven2 结合使用时遇到错误。我知道它找不到 native 库(dll 或 .so),因为我知道我无法将 native 库复制到我的 WEB-INF/lib 目录中...我
我从 Hyperic (http://www.hyperic.com/products/sigar) 发现了 Sigar API,它是一个用于 Java 的系统信息和报告 API。它大量使用 JNI
我需要获取系统中所有磁盘或所有分区的可用磁盘空间,我不介意。 (我不必使用 Sigar,但我已经在项目中将其用于其他一些流程,因此我也可以将其用于此目的)我正在使用 Sigar API 并得到了这个
我已经下载了 Sigar API ( http://support.hyperic.com/display/SIGAR/Home) 并想在项目中使用它来获取有关正在运行的不同进程的信息。 我的问题是我
我目前正尝试在 maven-build 中使用 Sigar,它每次都显示: “org.hyperic.sigar.SigarException:java.library.path 中没有 libsig
我是 Java 的新手,所以我不知道在我必须使用 Sigar 类的项目中从谁那里获得下载 zip 文件 (hyperic-sigar-1.6.4.zip)。 我已经尝试导入 Sigar.Jar 文件,
第一,抱歉我的英语不好,我是法国人,但我认为这是解决我的问题的最佳网站! 我试图将两个 dll 放入我的 jar 中:sigar-amd64-winnt.dll 和 sigar-x86-winnt.d
我是一名优秀的程序员,十分优秀!