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

Java ObjectPack类代码示例

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

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



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

示例1: getMainObject

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private ObjectPack getMainObject() {
	Configure conf = Configure.getInstance();
	ObjectPack p = new ObjectPack();
	p.objType = conf.obj_type;
	p.objHash = conf.getObjHash();
	p.objName = conf.getObjName();
	p.version = Version.getAgentFullVersion();
	p.address = TcpWorker.localAddr;
	if(StringUtil.isNotEmpty(conf.getObjExtType())){
		p.tags.put(TAG_OBJ_EXT_TYPE, conf.getObjExtType());
	}
	if(StringUtil.isNotEmpty(conf.getObjDetectedType())){
		p.tags.put(TAG_OBJ_DETECTED_TYPE, conf.getObjDetectedType());
	}

	if (ToolsMainFactory.activeStack) {
		p.tags.put(TAG_ACTIVE_STACK, new BooleanValue(true));
	}
	p.tags.put(TAG_AUTODUMP_CPU_ENABLED, new BooleanValue(conf.autodump_cpu_exceeded_enabled));
	if (conf.autodump_cpu_exceeded_enabled) {
           p.tags.put(TAG_AUTODUMP_CPU_THRESHOLD, conf.autodump_cpu_exceeded_threshold_pct);
		p.tags.put(TAG_AUTODUMP_CPU_DURATION, conf.autodump_cpu_exceeded_duration_ms);
	}
	return p;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:26,代码来源:AgentHeartBeat.java


示例2: getMainObject

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private ObjectPack getMainObject() {
	Configure conf = Configure.getInstance();
	ObjectPack p = new ObjectPack();
	p.objType = conf.obj_type;
	p.objHash = conf.getObjHash();
	p.objName = conf.getObjName();

	p.version = Version.getAgentFullVersion();
	p.address = TcpWorker.localAddr;

	if(StringUtil.isNotEmpty(conf.getObjDetectedType())){
		p.tags.put(TAG_OBJ_DETECTED_TYPE, conf.getObjDetectedType());
	}

	return p;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:17,代码来源:AgentHeartBeat.java


示例3: objType

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public String objType(XLogPack p) {
	ObjectPack a = AgentManager.getAgent(p.objHash);
	if (a != null) {
		return a.objType;
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:IXLog.java


示例4: getObjName

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
@ConfigDesc("get current object name.")
public String getObjName() {
	if (_objName != null)
		return _objName;
	ObjectPack a = AgentManager.getAgent(_objHash);
	if (a != null && a.objName != null) {
		_objName = a.objName;
	}
	return _objName;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:RealCounter.java


示例5: getObjType

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
@ConfigDesc("get current object type name.")
public String getObjType() {
	ObjectPack a = AgentManager.getAgent(_objHash);
	if (a == null)
		return _objType;
	if (a.objType != null) {
		_objType = a.objType;
	}
	return _objType;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:RealCounter.java


示例6: active

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public static void active(ObjectPack p) {
       BuiltInPluginManager.invokeAllPlugins(PluginConstants.PLUGIN_SERVER_OBJECT, p);

	if (objects != null) {
		try {
			objects.process(p);
		} catch (Throwable t) {
			Logger.printStackTrace("PL004", t);
		}
	}

}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:PlugInManager.java


示例7: process

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private static void process(JSONObject json) throws Exception {
	JSONObject objectInfo = (JSONObject) json.get("object");
	if (objectInfo != null) {
		ObjectPack objPack = extractObjectPack(objectInfo);
		InetAddress addr = extractIpv4Address(objectInfo);
		passToNetDataProcessor(objPack, addr);
		JSONArray perfArray = (JSONArray) json.get("counters");
		if (perfArray != null) {
			PerfCounterPack perfPack = extractPerfCounterPack(perfArray, objPack.objName);
			passToNetDataProcessor(perfPack, addr);
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:CounterHandler.java


示例8: extractObjectPack

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private static ObjectPack extractObjectPack(JSONObject objJson) {
	String host = (String) objJson.get("host");
	String name = (String) objJson.get("name");
	String objName = getObjName(host, name);
	int objHash = HashUtil.hash(objName);
	ObjectPack objPack = new ObjectPack();
	objPack.objHash = objHash;
	objPack.objName = objName;
	objPack.objType = (String) objJson.get("type");
	objPack.address = (String) objJson.get("address");
	return objPack;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:CounterHandler.java


示例9: findObjectPack

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private void findObjectPack() {
	ArrayList<ObjectPack> packList= AgentModelThread.getInstance().getAgentPackList();
	for (ObjectPack objectPack : packList) {
		if (objectPack.objHash == this.objHash) {
			CounterEngine counterEngine = ServerManager.getInstance().getServer(serverId).getCounterEngine();
			String code = counterEngine.getMasterCounter(objectPack.objType);
			objectPack.tags.put("main counter", code);
			this.objectPack = objectPack;
			break;
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:ObjectPropertiesDialog.java


示例10: getObjectPack

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
static public ObjectPack getObjectPack(){
	Configure conf = Configure.getInstance();
	ObjectPack pack = new ObjectPack();
	pack.alive = true;
	pack.objHash = conf.getObjHash();
	pack.objName = conf.getObjName();
	pack.objType = conf.obj_type;
	pack.version = Version.getAgentFullVersion();
	return pack;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:Main.java


示例11: SObject

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
private SObject(ObjectPack p, Server server) {
    this.objType = p.objType;
    this.objFamily = server.getCounterEngine().getFamilyNameFromObjType(p.objType);
    this.objHash = p.objHash;
    this.objName = p.objName;
    this.address = p.address;
    this.version = p.version;
    this.alive = p.alive;
    this.lastWakeUpTime = p.wakeup;
    for (Map.Entry<String, Value> e : p.tags.toMap().entrySet()) {
        tags.put(e.getKey(), e.getValue().toJavaObject());
    }
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:SObject.java


示例12: retrieveObjectList

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
/**
 * retrieve object(agent) list from collector server
 */
public List<SObject> retrieveObjectList(final Server server) {
    List<SObject> objectList = null;
    try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) {
        objectList = tcpProxy
                .process(RequestCmd.OBJECT_LIST_REAL_TIME, null).stream()
                .map(p -> SObject.of((ObjectPack) p, server))
                .collect(Collectors.toList());
    }

    return objectList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:15,代码来源:ObjectConsumer.java


示例13: addObject

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public static void addObject(String objType, int objHash, String objName) {
	if (objName == null)
		return;
	if (objName.equals(Configure.getInstance().getObjName()))
		return;
	ObjectPack old = objects.get(objName);
	if (old != null && objType.equals(old.objType)) {
		return;
	}
	ObjectPack p = new ObjectPack();
	p.objType = objType;
	p.objHash = objHash;
	p.objName = objName;
	objects.put(objName, p);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:AgentHeartBeat.java


示例14: alive

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
@Counter
public void alive(CounterBasket pw) {
	DataProxy.sendHeartBeat(getMainObject());
	Enumeration<ObjectPack> en = objects.values();
	while (en.hasMoreElements()) {
		DataProxy.sendHeartBeat(en.nextElement());
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:AgentHeartBeat.java


示例15: addObject

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public static void addObject(String objType, int objHash, String objName) {

		ObjectPack old = objects.get(objName);

		if (old != null && objType.equals(old.objType)) {
			return;
		}
		ObjectPack p = new ObjectPack();
		p.objType = objType;
		p.objHash = objHash;
		p.objName = objName;
		objects.put(objName, p);
	}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:AgentHeartBeat.java


示例16: sendHeartBeat

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public static void sendHeartBeat(ObjectPack p) {
	try {
		udpCollect.write(new DataOutputX().writePack(p).toByteArray());
	} catch (Exception e) {
	}
	if (conf.log_udp_object) {
		Logger.info(p.toString());
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:10,代码来源:DataProxy.java


示例17: object

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
/**
  * ObjectPack 발생 시 처리
  * @param pack
  */
 @ServerPlugin(PluginConstants.PLUGIN_SERVER_OBJECT)
 public void object(ObjectPack pack) {
     if (!pack.objType.equals(CounterConstants.REQUESTPROCESS)) {
      AgentInfo agentInfo = null;
ObjectPack op = AgentManager.getAgent(pack.objHash);
boolean isExist = true;
boolean isDownState = false;
      
// Plugin의 loading이 채 끝나기 전에 agent로부터 heartbeat 메시지가 수신되는 경우
// 해당 Agent의 구동 정보가 누락될 수 있기 때문에 매번 agent의 상태를 조회한다.

agentInfo = selectAgentInfo(pack.objHash);
if (agentInfo == null) {
	agentInfo = new AgentInfo();
	isExist = false;
} else {
	Date lastDownTime = agentInfo.getLast_down_time();
	Date lastUpTime = agentInfo.getLast_up_time();
	
	if (lastDownTime != null && lastUpTime != null) {
		if (lastDownTime.getTime() - lastUpTime.getTime() > 0) {
			isDownState = true;
		}
	}
}

if ((op == null && pack.wakeup == 0L) || op.alive == false || !isExist || isDownState) {
          println("[AgentInfo] : " + agentInfo);
	
	agentInfo.setObject_hash(pack.objHash);
	agentInfo.setObject_name(pack.objName);
	agentInfo.setObject_type(pack.objType);
	
	if (pack.objType != null) {
          	String object_family;
          	
		try {
			object_family = CounterManager.getInstance().getCounterEngine().getObjectType(pack.objType).getFamily().getName();
		} catch (Exception e) {
			object_family = pack.objType;
		}
		
          	agentInfo.setObject_family(object_family);
          }
	
	agentInfo.setIp_address(pack.address);
	agentInfo.setLast_up_time(new Date(System.currentTimeMillis()));
	
	if (isExist) {
		updateAgentInfo(agentInfo);
	} else {
		insertAgentInfo(agentInfo);
	}
  	}
     }
 }
 
开发者ID:OpenSourceConsulting,项目名称:scouter-plugin-server-reporting,代码行数:61,代码来源:ReportingPlugin.java


示例18: EmailPlugin

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public EmailPlugin() {
   	if (ai.incrementAndGet() == 1) {
    	ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
    	
    	// thread count check
    	executor.scheduleAtFixedRate(new Runnable() {
			@Override
			public void run() {
				for (int objHash : javaeeObjHashList) {
					try {
						if (AgentManager.isActive(objHash)) {
							ObjectPack objectPack = AgentManager.getAgent(objHash);
							MapPack mapPack = new MapPack();
			            	mapPack.put("objHash", objHash);
			            	
							mapPack = AgentCall.call(objectPack, RequestCmd.OBJECT_THREAD_LIST, mapPack);
							
			        		int threadCountThreshold = conf.getInt("ext_plugin_thread_count_threshold", 0);
			        		int threadCount = mapPack.getList("name").size();
			        		
			        		if (threadCountThreshold != 0 && threadCount > threadCountThreshold) {
			        			AlertPack ap = new AlertPack();
			        			
			    		        ap.level = AlertLevel.WARN;
			    		        ap.objHash = objHash;
			    		        ap.title = "Thread count exceed a threshold.";
			    		        ap.message = objectPack.objName + "'s Thread count(" + threadCount + ") exceed a threshold.";
			    		        ap.time = System.currentTimeMillis();
			    		        ap.objType = objectPack.objType;
			    				
			    		        alert(ap);
			        		}
						}
					} catch (Exception e) {
						// ignore
					}
				}
			}
    	}, 
    	0, 5, TimeUnit.SECONDS);
   	}
}
 
开发者ID:scouter-project,项目名称:scouter-plugin-server-alert-email,代码行数:43,代码来源:EmailPlugin.java


示例19: SlackPlugin

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public SlackPlugin() {
   	if (ai.incrementAndGet() == 1) {
    	ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);

    	// thread count check
    	executor.scheduleAtFixedRate(new Runnable() {
			@Override
			public void run() {
				for (int objHash : javaeeObjHashList) {
					try {
						if (AgentManager.isActive(objHash)) {
							ObjectPack objectPack = AgentManager.getAgent(objHash);
							MapPack mapPack = new MapPack();
			            	mapPack.put("objHash", objHash);

							mapPack = AgentCall.call(objectPack, RequestCmd.OBJECT_THREAD_LIST, mapPack);

			        		int threadCountThreshold = conf.getInt("ext_plugin_thread_count_threshold", 0);
			        		int threadCount = mapPack.getList("name").size();

			        		if (threadCountThreshold != 0 && threadCount > threadCountThreshold) {
			        			AlertPack ap = new AlertPack();

			    		        ap.level = AlertLevel.WARN;
			    		        ap.objHash = objHash;
			    		        ap.title = "Thread count exceed a threshold.";
			    		        ap.message = objectPack.objName + "'s Thread count(" + threadCount + ") exceed a threshold.";
			    		        ap.time = System.currentTimeMillis();
			    		        ap.objType = objectPack.objType;

			    		        alert(ap);
			        		}
						}
					} catch (Exception e) {
						// ignore
					}
				}
			}
    	},
    	0, 5, TimeUnit.SECONDS);
   	}
}
 
开发者ID:scouter-project,项目名称:scouter-plugin-server-alert-slack,代码行数:43,代码来源:SlackPlugin.java


示例20: getAgentPackList

import scouter.lang.pack.ObjectPack; //导入依赖的package包/类
public ArrayList<ObjectPack> getAgentPackList(){
	return allAgentList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:4,代码来源:AgentModelThread.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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