|
|
package com.monitor.javaserver.handle.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.monitor.influxdb.mapper.impl.JavaApiStaticsMapper;
|
|
|
import com.monitor.javaserver.common.JavaApiStatics;
|
|
|
import com.monitor.javaserver.handle.IJavaApiHadnler;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
|
* Created by fruwei on 2016/6/20.
|
|
|
*/
|
|
|
@Component("influxDBJavaApiHandler")
|
|
|
public class InfluxDBJavaApiHandler implements IJavaApiHadnler{
|
|
|
Logger log= LoggerFactory.getLogger(InfluxDBJavaApiHandler.class);
|
|
|
public class InfluxDBJavaApiHandler implements IJavaApiHadnler {
|
|
|
Logger log = LoggerFactory.getLogger(InfluxDBJavaApiHandler.class);
|
|
|
|
|
|
@Autowired
|
|
|
private JavaApiStaticsMapper javaApiStaticsMapper;
|
|
|
|
|
|
@Override
|
|
|
public void handler(JavaApiStatics javaApiStatics) {
|
|
|
log.info("handle result: {}",javaApiStatics);
|
|
|
//TODO handle
|
|
|
log.info("handle result: {}", javaApiStatics);
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("javaApiInfo", javaApiStatics.getJavaApiInfo());
|
|
|
jsonObject.put("mobject", javaApiStatics.getMObjectInfo());
|
|
|
jsonObject.put("statrt", javaApiStatics.getStartTime());
|
|
|
jsonObject.put("end", javaApiStatics.getEndTime());
|
|
|
javaApiStaticsMapper.insertJavaApiStatics(null, jsonObject);
|
|
|
|
|
|
|
|
|
}
|
...
|
...
|
|