当前位置: 首页>>代码示例>>Java>>正文


Java ObjectPack类代码示例

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


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


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