|
|
package com.monitor.javaserver.handle.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.model.JavaApiInfo;
|
|
|
import com.model.MObjectInfo;
|
|
|
import com.monitor.influxdb.mapper.impl.JavaApiStaticsMapper;
|
|
|
import com.monitor.javaserver.common.JavaApiStatics;
|
|
|
import com.monitor.javaserver.handle.IJavaApiHadnler;
|
...
|
...
|
@@ -21,14 +23,33 @@ public class InfluxDBJavaApiHandler implements IJavaApiHadnler { |
|
|
|
|
|
@Override
|
|
|
public void handler(JavaApiStatics javaApiStatics) {
|
|
|
log.info("handle result: {}", javaApiStatics);
|
|
|
// log.info("handle result: {}", javaApiStatics);
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("javaApiInfo", javaApiStatics.getJavaApiInfo());
|
|
|
jsonObject.put("mobject", javaApiStatics.getMObjectInfo());
|
|
|
jsonObject.put("statrt", javaApiStatics.getStartTime());
|
|
|
JavaApiInfo javaApiInfo = javaApiStatics.getJavaApiInfo();
|
|
|
jsonObject.put("api_id", javaApiInfo.getServiceId());
|
|
|
jsonObject.put("api_name", javaApiInfo.getApiName());
|
|
|
jsonObject.put("api_type", javaApiInfo.getServiceType());
|
|
|
jsonObject.put("api_url", javaApiInfo.getApiUrl());
|
|
|
|
|
|
MObjectInfo mobjInfo = javaApiStatics.getMObjectInfo();
|
|
|
|
|
|
jsonObject.put("mobj_name", mobjInfo.getMoName());
|
|
|
jsonObject.put("mobj_ip", mobjInfo.getMoHostIp());
|
|
|
jsonObject.put("mobj_id", mobjInfo.getMoId());
|
|
|
if (mobjInfo.getMoTags() != null)
|
|
|
jsonObject.put("mobj_port", mobjInfo.getMoTags());
|
|
|
else
|
|
|
jsonObject.put("mobj_port", "");
|
|
|
|
|
|
jsonObject.put("start", javaApiStatics.getEndTime());
|
|
|
jsonObject.put("end", javaApiStatics.getEndTime());
|
|
|
|
|
|
jsonObject.put("is_exception", javaApiStatics.isHasException());
|
|
|
jsonObject.put("exception", javaApiStatics.getException());
|
|
|
|
|
|
|
|
|
javaApiStaticsMapper.insertJavaApiStatics(null, jsonObject);
|
|
|
|
|
|
|
...
|
...
|
|