Search in sources :

Example 1 with StandardMonitorRepository

use of com.creditease.agent.monitor.api.StandardMonitorRepository in project uavstack by uavorg.

the class JMXJavaMonitorDataCatchWorker method doCaptureMonitorData.

/**
 * --------------------------------------------Monitor Data----------------------------------------------------
 */
/**
 * TODO: doCaptureMonitorData
 *
 * @param timeFlag
 * @param mbsc
 * @return needProcessCheck
 */
private boolean doCaptureMonitorData(long timeFlag, MBeanServerConnection mbsc) {
    StandardMonitorRepository smr = new StandardMonitorRepository();
    // MEId: jvm
    if (doCaptureMO_JVM(mbsc, smr) == true) {
        return true;
    }
    // 自定义指标 goes to jvm
    doCaptureMO_CustomizedMetrics(smr);
    // UAV MSCP Application
    doCaptureMO_MSCPApp(smr);
    // build MDF
    MonitorDataFrame mdf = new MonitorDataFrame(this.getWorkerId(), "M", timeFlag);
    mdf.addData("server", smr.toJSONString());
    // add appgroup to MDF
    mdf.addExt("appgroup", this.getAppGroup());
    /**
     * if there is data, we handle MDF using monitor data handler to process the monitor data
     */
    if (!mdf.isEmpty()) {
        List<MonitorDataFrame> ml = new ArrayList<MonitorDataFrame>();
        ml.add(mdf);
        this.detector.runHandlers(ml);
    }
    return false;
}
Also used : ArrayList(java.util.ArrayList) MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame) StandardMonitorRepository(com.creditease.agent.monitor.api.StandardMonitorRepository)

Aggregations

MonitorDataFrame (com.creditease.agent.monitor.api.MonitorDataFrame)1 StandardMonitorRepository (com.creditease.agent.monitor.api.StandardMonitorRepository)1 ArrayList (java.util.ArrayList)1