use of com.creditease.uav.threadanalysis.data.JavaThreadObject in project uavstack by uavorg.
the class ThreadAnalysisCollectDataHandler method handle.
/**
* 数据归集feature消费者消息接收方法
*/
@Override
public void handle(CollectDataFrame frame) {
if (this.log.isDebugEnable()) {
this.log.debug(this, frame.toJSONString());
}
// 线程分析文件按次生成,一次采集完,应该在一个 CollectDataFrame 中
if (!frame.isEof()) {
return;
}
/**
* TODO:pname到底从哪获得呢?
*/
String pname = "";
String appgroup = frame.getAppgroup();
String appUUID = frame.getTarget();
String[] target = appUUID.split("_");
// 获取数据归集feature的消费信息,frame为一条消费信息,从fame中获取lines为线程分析文件的消费信息
List<Line> list = frame.getLines();
// 调用线程分析文件信息处理方法
List<JavaThreadObject> result = analyse(list);
/**
* add additional information: pname,ipport,pid,appgroup,time,user
*/
for (JavaThreadObject jto : result) {
jto.setPname(pname);
jto.setIpport(target[0]);
jto.setPid(target[1]);
jto.setAppgroup(appgroup);
jto.setTime(Long.parseLong(target[2]));
jto.setUser(target[3]);
}
// 处理数据保存工作
insertThreadObjectToES(result);
}
Aggregations