• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SigarInvokerJMX类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hyperic.sigar.jmx.SigarInvokerJMX的典型用法代码示例。如果您正苦于以下问题:Java SigarInvokerJMX类的具体用法?Java SigarInvokerJMX怎么用?Java SigarInvokerJMX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SigarInvokerJMX类属于org.hyperic.sigar.jmx包,在下文中一共展示了SigarInvokerJMX类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: output

import org.hyperic.sigar.jmx.SigarInvokerJMX; //导入依赖的package包/类
public void output(String[] args) throws SigarException {

        this.mode = "Cur";
        this.invoker =
            SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit");

        for (int i=0; i<args.length; i++) {
            String arg = args[i];
            if (arg.equals("-H")) {
                this.mode = "Max";
            }
            else if (arg.equals("-S")) {
                this.mode = "Cur";
            }
            else {
                throw new SigarException("Unknown argument: " + arg);
            }
        }
        
        println("core file size......." + getValue("Core"));
        println("data seg size........" + getValue("Data"));
        println("file size............" + getValue("FileSize"));
        println("pipe size............" + getValue("PipeSize"));
        println("max memory size......" + getValue("Memory"));
        println("open files..........." + getValue("OpenFiles"));
        println("stack size..........." + getValue("Stack"));
        println("cpu time............." + getValue("Cpu"));
        println("max user processes..." + getValue("Processes"));
        println("virtual memory......." + getValue("VirtualMemory"));
    }
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:31,代码来源:Ulimit.java


示例2: output

import org.hyperic.sigar.jmx.SigarInvokerJMX; //导入依赖的package包/类
public void output(String[] args) throws SigarException {
	this.mode = "Cur";
	this.invoker = SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit");
	
	for (int i = 0; i < args.length; ++i) {
		String arg = args[i];
		if (arg.equals("-H")) {
			this.mode = "Max";
		} else {
			if (!arg.equals("-S")) {
				throw new SigarException("Unknown argument: " + arg);
			}
			
			this.mode = "Cur";
		}
	}
	
	this.println("core file size......." + this.getValue("Core"));
	this.println("data seg size........" + this.getValue("Data"));
	this.println("file size............" + this.getValue("FileSize"));
	this.println("pipe size............" + this.getValue("PipeSize"));
	this.println("max memory size......" + this.getValue("Memory"));
	this.println("open files..........." + this.getValue("OpenFiles"));
	this.println("stack size..........." + this.getValue("Stack"));
	this.println("cpu time............." + this.getValue("Cpu"));
	this.println("max user processes..." + this.getValue("Processes"));
	this.println("virtual memory......." + this.getValue("VirtualMemory"));
}
 
开发者ID:cqyijifu,项目名称:watcher,代码行数:29,代码来源:WatcherUlimit.java


示例3: getUlimitInfo

import org.hyperic.sigar.jmx.SigarInvokerJMX; //导入依赖的package包/类
public Map<String, String> getUlimitInfo() throws SigarException {
	if (!result.isEmpty()) {
		return result;
	}
	this.mode = "Cur";
	this.invoker = SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit");
	
	for (String s : map.keySet()) {
		String val = null;
		try {
			val = this.getValue(s);
		} catch (SigarException e) {
			logger.error("获取ulimit[{}]信息失败", s, e);
			val = "error";
		}
		result.put(s, val);
	}
	return result;
	
	//this.println("core file size......." + this.getValue("Core"));
	//this.println("data seg size........" + this.getValue("Data"));
	//this.println("file size............" + this.getValue("FileSize"));
	//this.println("pipe size............" + this.getValue("PipeSize"));
	//this.println("max memory size......" + this.getValue("Memory"));
	//this.println("open files..........." + this.getValue("OpenFiles"));
	//this.println("stack size..........." + this.getValue("Stack"));
	//this.println("cpu time............." + this.getValue("Cpu"));
	//this.println("max user processes..." + this.getValue("Processes"));
	//this.println("virtual memory......." + this.getValue("VirtualMemory"));
}
 
开发者ID:cqyijifu,项目名称:watcher,代码行数:31,代码来源:WatcherUlimit.java


示例4: output

import org.hyperic.sigar.jmx.SigarInvokerJMX; //导入依赖的package包/类
@Override
public void output(String[] args) throws SigarException {

    this.mode = "Cur";
    this.invoker = SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit");
    
    for (String arg : args) {
        switch (arg) {
            case "-H":
                this.mode = "Max";
                break;
            case "-S":
                this.mode = "Cur";
                break;
            default:
                throw new SigarException("Unknown argument: " + arg);
        }
    }

    try {
        bos.write(("== SYSTEM LIMITS ==\n").getBytes());
        bos.write(("Core file size......." + getValue("Core") + "\n").getBytes());
        bos.write(("Data seg size........" + getValue("Data") + "\n").getBytes());
        bos.write(("File size............" + getValue("FileSize") + "\n").getBytes());
        bos.write(("Pipe size............" + getValue("PipeSize") + "\n").getBytes());
        bos.write(("Max memory size......" + getValue("Memory") + "\n").getBytes());
        bos.write(("Open files..........." + getValue("OpenFiles") + "\n").getBytes());
        bos.write(("Stack size..........." + getValue("Stack") + "\n").getBytes());
        bos.write(("CPU time............." + getValue("Cpu") + "\n").getBytes());
        bos.write(("Max user processes..." + getValue("Processes") + "\n").getBytes());
        bos.write(("Virtual memory......." + getValue("VirtualMemory") + "\n").getBytes());
    } catch(Exception ex) {
        System.out.println("[CF LOG] Error retrieving system stats");
    }
    
}
 
开发者ID:OneSourceConsult,项目名称:JavaProfiling-tool,代码行数:37,代码来源:Ulimit.java



注:本文中的org.hyperic.sigar.jmx.SigarInvokerJMX类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HtmlFileImpl类代码示例发布时间:2022-05-23
下一篇:
Java Property类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap