本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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());
}
}
示例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;
}
示例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);
}
示例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());
}
}
示例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);
}