Search in sources :

Example 1 with MonitorDataFrame

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

the class AppServerLogPublishWorker method handle.

@Override
protected void handle(List<MonitorDataFrame> mdflist) {
    MessageProducer producer = (MessageProducer) this.getComponentResource("messageproducer", "MessageProducerResourceComponent");
    // submit profile data
    Message msg = MessagingFactory.createMessage(MonitorDataFrame.MessageType.Log.toString());
    StringBuilder sb = new StringBuilder("[");
    for (MonitorDataFrame mdf : mdflist) {
        sb.append(mdf.toJSONString() + ",");
    }
    if (mdflist.size() > 0) {
        sb = sb.deleteCharAt(sb.length() - 1);
    }
    String stream = sb.append("]").toString();
    msg.setParam(MonitorDataFrame.MessageType.Log.toString(), stream);
    if (log.isDebugEnable()) {
        log.debug(this, "## LogPublishWorker stream length ## : " + stream.getBytes().length);
        log.debug(this, "## LogPublishWorker stream value ## : " + stream);
    }
    producer.setLogger(log);
    boolean check = producer.submit(msg);
    String sendState = "Log Data Sent " + (check ? "SUCCESS" : "FAIL");
    if (log.isDebugEnable()) {
        log.debug(this, sendState + " " + sendState);
    }
    if (null != getConfigManager().getComponent("monitortestagent", "MonitorAgentUT")) {
        AgentFeatureComponent afc = (AgentFeatureComponent) this.getConfigManager().getComponent("monitortestagent", "monitortestagent");
        afc.exchange("logTest", mdflist);
    }
}
Also used : Message(com.creditease.uav.messaging.api.Message) MessageProducer(com.creditease.uav.messaging.api.MessageProducer) MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame) AgentFeatureComponent(com.creditease.agent.spi.AgentFeatureComponent)

Example 2 with MonitorDataFrame

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

the class TaildirLogComponent method sendToPublisher.

@SuppressWarnings("rawtypes")
public void sendToPublisher(Map<TailFile, List<Map>> serverlogs) {
    Map<String, MonitorDataFrame> mdfs = Maps.newHashMap();
    AppServerLogPublishWorker aplc = (AppServerLogPublishWorker) this.getConfigManager().getComponent(this.feature, "AppServerLogPublishWorker");
    MonitorDataFrame mdf = null;
    TailFile file = null;
    for (Entry<TailFile, List<Map>> applogs : serverlogs.entrySet()) {
        file = applogs.getKey();
        if (mdfs.containsKey(file.getServerId())) {
            mdf = mdfs.get(file.getServerId());
        } else {
            mdf = new MonitorDataFrame(file.getServerId(), "L");
            // 给日志添加应用组信息
            mdf.addExt("appgroup", System.getProperty("JAppGroup"));
            mdf.addExt("appurl", file.getAppUrl());
            mdfs.put(file.getServerId(), mdf);
        }
        // mdf.addData(file.getAppId() + "," + file.getLogId(), applogs.getValue());
        mdf.addData(file.getAppId(), wearClothes(file.getLogId(), applogs.getValue()));
        if (log.isDebugEnable()) {
            log.debug(this, "## after filename:" + file.getInode());
            log.debug(this, "## after mdf:  " + mdf.toJSONString());
            log.debug(this, "## after mdf length: " + mdf.toJSONString().getBytes().length);
        }
    }
    for (MonitorDataFrame smdf : mdfs.values()) {
        aplc.putData(smdf);
    }
}
Also used : List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame)

Example 3 with MonitorDataFrame

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

the class BaseHttpMonitorDataCatchWorker method run.

@Override
public void run() {
    try {
        boolean needProcessCheck = true;
        long timeFlag = (System.currentTimeMillis() / 10) * 10;
        // get all monitor's MBean
        MonitorDataFrame mdf = new MonitorDataFrame(this.getWorkerId(), "M", timeFlag);
        needProcessCheck = doCaptureMonitorData(timeFlag, mdf);
        // if needProcessCheck is still true, need see if the appserver is still alive
        if (needProcessCheck == true) {
            doHealthReaction();
            return;
        } else {
            /**
             * 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);
            }
        }
        // get all profile's MBean
        MonitorDataFrame pmdf = new MonitorDataFrame(this.getWorkerId(), "P", timeFlag);
        needProcessCheck = doCaptureProfileData(timeFlag, pmdf);
        // if needProcessCheck is still true, need see if the appserver is still alive
        if (needProcessCheck == true) {
            doHealthReaction();
            return;
        } else {
            /**
             * if there is data, we handle MDF
             */
            if (!pmdf.isEmpty()) {
                /**
                 * as profile data is low frequency data, then we just need 1 thread for all appservers on the same
                 * host machine to publish the data
                 */
                AppServerProfileDataCatchWorker apdc = (AppServerProfileDataCatchWorker) this.getConfigManager().getComponent(this.feature, "AppServerProfileDataCatchWorker");
                apdc.putData(pmdf);
            }
        }
    } catch (IOException e) {
        // if connect fails, try process detecting
        doHealthReaction();
    }
}
Also used : ArrayList(java.util.ArrayList) AppServerProfileDataCatchWorker(com.creditease.agent.feature.monitoragent.AppServerProfileDataCatchWorker) MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame) IOException(java.io.IOException)

Example 4 with MonitorDataFrame

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

the class DoTestMonitorDataFrame method main.

public static void main(String[] args) {
    String test = "{	        \"time\": 145915028391,	        \"host\": \"09-201506110096\",	        \"ip\": \"192.168.99.1\",	        \"svrid\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65::E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65\",	        \"tag\": \"P\",	        \"frames\": {	            \"manager\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {}	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {	                                \"org.apache.catalina.manager.HTMLManagerServlet\": {	                                    \"des\": {	                                        \"name\": \"HTMLManager\",	                                        \"urlPatterns\": [	                                            \"/html/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.manager.ManagerServlet\": {	                                    \"des\": {	                                        \"name\": \"Manager\",	                                        \"urlPatterns\": [	                                            \"/text/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.manager.JMXProxyServlet\": {	                                    \"des\": {	                                        \"name\": \"JMXProxy\",	                                        \"urlPatterns\": [	                                            \"/jmxproxy/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.manager.StatusManagerServlet\": {	                                    \"des\": {	                                        \"name\": \"Status\",	                                        \"urlPatterns\": [	                                            \"/status/*\"	                                        ]	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {	                                \"org.apache.catalina.filters.SetCharacterEncodingFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"SetCharacterEncoding\",	                                        \"urlPatterns\": [	                                            \"/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.filters.CsrfPreventionFilter\": {	                                    \"des\": {	                                        \"servletNames\": [	                                            \"HTMLManager\",	                                            \"jsp\"	                                        ],	                                        \"filterName\": \"CSRF\",	                                        \"urlPatterns\": []	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"Tomcat Manager Application\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/manager\",	                                \"appurl\": \"http://192.168.99.1:8080/manager/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ],	            \"com.creditease.uav.console\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {	                                \"classes\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/classes/\",	                                \"javax.ws.rs-api-2.0.1.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/javax.ws.rs-api-2.0.1.jar\",	                                \"jersey-client-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-client-2.22.jar\",	                                \"jersey-guava-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-guava-2.22.jar\",	                                \"jersey-container-servlet-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-container-servlet-2.22.jar\",	                                \"hk2-locator-2.4.0-b31.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/hk2-locator-2.4.0-b31.jar\",	                                \"osgi-resource-locator-1.0.1.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/osgi-resource-locator-1.0.1.jar\",	                                \"hk2-api-2.4.0-b31.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/hk2-api-2.4.0-b31.jar\",	                                \"javax.inject-2.4.0-b31.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/javax.inject-2.4.0-b31.jar\",	                                \"jersey-server-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-server-2.22.jar\",	                                \"aredis-api-1.4.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/aredis-api-1.4.jar\",	                                \"aopalliance-repackaged-2.4.0-b31.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/aopalliance-repackaged-2.4.0-b31.jar\",	                                \"validation-api-1.1.0.Final.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/validation-api-1.1.0.Final.jar\",	                                \"javassist-3.18.1-GA.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/javassist-3.18.1-GA.jar\",	                                \"jersey-container-servlet-core-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-container-servlet-core-2.22.jar\",	                                \"jersey-media-jaxb-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-media-jaxb-2.22.jar\",	                                \"hk2-utils-2.4.0-b31.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/hk2-utils-2.4.0-b31.jar\",	                                \"javax.annotation-api-1.2.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/javax.annotation-api-1.2.jar\",	                                \"commons-logging-1.2.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/commons-logging-1.2.jar\",	                                \"jersey-common-2.22.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console/WEB-INF/lib/jersey-common-2.22.jar\"	                            }	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {	                                \"com.creditease.uav.apphub.core.AppHubRestServlet\": {	                                    \"des\": {	                                        \"loadOnStartup\": \"1\",	                                        \"name\": \"jersey-serlvet\",	                                        \"urlPatterns\": [	                                            \"/rs/*\"	                                        ]	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {	                                \"com.creditease.uav.godeye.rest.GodEyeRestService\": {	                                    \"methods\": {	                                        \"loadUavNetworkInfo\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadUavNetworkInfo\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"ping\": {	                                            \"anno\": {	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        }	                                    },	                                    \"anno\": {	                                        \"javax.ws.rs.Path\": {	                                            \"value\": \"godeye\"	                                        }	                                    }	                                },	                                \"com.creditease.uav.apphub.rest.GUIService\": {	                                    \"methods\": {	                                        \"jumpMainPage\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"jumpMainPage\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:void\"	                                            ]	                                        },	                                        \"loadAppMenu\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadAppMenu\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"loadMainMenu\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadMainMenu\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"loadMainAppIco\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadMainAppIco\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"login\": {	                                            \"anno\": {	                                                \"javax.ws.rs.POST\": {},	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"login\"	                                                }	                                            },	                                            \"para\": [	                                                \"java.lang.String\",	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"ping\": {	                                            \"anno\": {	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"loadAppTemp\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadAppTemp\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        },	                                        \"jumpAppPage\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"jumpAppPage\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"java.lang.String\",	                                                \"R:void\"	                                            ]	                                        },	                                        \"loadTemp\": {	                                            \"anno\": {	                                                \"javax.ws.rs.Path\": {	                                                    \"value\": \"loadTemp\"	                                                },	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"java.lang.String\",	                                                \"R:java.lang.String\"	                                            ]	                                        }	                                    },	                                    \"anno\": {	                                        \"javax.ws.rs.Path\": {	                                            \"value\": \"gui\"	                                        }	                                    }	                                },	                                \"com.creditease.uav.apphub.rest.APIService\": {	                                    \"methods\": {	                                        \"ping\": {	                                            \"anno\": {	                                                \"javax.ws.rs.GET\": {}	                                            },	                                            \"para\": [	                                                \"R:java.lang.String\"	                                            ]	                                        }	                                    },	                                    \"anno\": {	                                        \"javax.ws.rs.Path\": {	                                            \"value\": \"api\"	                                        }	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"UAV管理控制台\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/com.creditease.uav.console\",	                                \"appurl\": \"http://192.168.99.1:8080/com.creditease.uav.console/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ],	            \"docs\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {}	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"Tomcat Documentation\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/docs\",	                                \"appurl\": \"http://192.168.99.1:8080/docs/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ],	            \"ROOT\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {}	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"Welcome to Tomcat\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/ROOT\",	                                \"appurl\": \"http://192.168.99.1:8080/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ],	            \"examples\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {	                                \"classes\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/examples/WEB-INF/classes/\",	                                \"taglibs-standard-impl-1.2.5.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/examples/WEB-INF/lib/taglibs-standard-impl-1.2.5.jar\",	                                \"taglibs-standard-spec-1.2.5.jar\": \"file:/E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/examples/WEB-INF/lib/taglibs-standard-spec-1.2.5.jar\"	                            }	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {	                                \"RequestInfoExample\": {	                                    \"des\": {	                                        \"name\": \"RequestInfoExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/RequestInfoExample/*\"	                                        ]	                                    }	                                },	                                \"CookieExample\": {	                                    \"des\": {	                                        \"name\": \"CookieExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/CookieExample\"	                                        ]	                                    }	                                },	                                \"ServletToJsp\": {	                                    \"des\": {	                                        \"name\": \"ServletToJsp\",	                                        \"urlPatterns\": [	                                            \"/servletToJsp\"	                                        ]	                                    }	                                },	                                \"websocket.tc7.chat.ChatWebSocketServlet\": {	                                    \"des\": {	                                        \"name\": \"wsChat\",	                                        \"urlPatterns\": [	                                            \"/websocket/tc7/chat\"	                                        ]	                                    }	                                },	                                \"compressionFilters.CompressionFilterTestServlet\": {	                                    \"des\": {	                                        \"name\": \"CompressionFilterTestServlet\",	                                        \"urlPatterns\": [	                                            \"/CompressionTest\"	                                        ]	                                    }	                                },	                                \"websocket.tc7.snake.SnakeWebSocketServlet\": {	                                    \"des\": {	                                        \"name\": \"wsSnake\",	                                        \"urlPatterns\": [	                                            \"/websocket/tc7/snake\"	                                        ]	                                    }	                                },	                                \"websocket.tc7.echo.EchoMessage\": {	                                    \"des\": {	                                        \"name\": \"wsEchoMessage\",	                                        \"urlPatterns\": [	                                            \"/websocket/tc7/echoMessage\"	                                        ]	                                    }	                                },	                                \"HelloWorldExample\": {	                                    \"des\": {	                                        \"name\": \"HelloWorldExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/HelloWorldExample\"	                                        ]	                                    }	                                },	                                \"websocket.tc7.echo.EchoStream\": {	                                    \"des\": {	                                        \"name\": \"wsEchoStream\",	                                        \"urlPatterns\": [	                                            \"/websocket/tc7/echoStream\"	                                        ]	                                    }	                                },	                                \"RequestHeaderExample\": {	                                    \"des\": {	                                        \"name\": \"RequestHeaderExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/RequestHeaderExample\"	                                        ]	                                    }	                                },	                                \"SessionExample\": {	                                    \"des\": {	                                        \"name\": \"SessionExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/SessionExample\"	                                        ]	                                    }	                                },	                                \"async.AsyncStockServlet\": {	                                    \"des\": {	                                        \"name\": \"stock\",	                                        \"asyncSupported\": \"true\",	                                        \"urlPatterns\": [	                                            \"/async/stockticker\"	                                        ]	                                    }	                                },	                                \"async.Async2\": {	                                    \"des\": {	                                        \"name\": \"async2\",	                                        \"asyncSupported\": \"true\",	                                        \"urlPatterns\": [	                                            \"/async/async2\"	                                        ]	                                    }	                                },	                                \"async.Async3\": {	                                    \"des\": {	                                        \"name\": \"async3\",	                                        \"asyncSupported\": \"true\",	                                        \"urlPatterns\": [	                                            \"/async/async3\"	                                        ]	                                    }	                                },	                                \"RequestParamExample\": {	                                    \"des\": {	                                        \"name\": \"RequestParamExample\",	                                        \"urlPatterns\": [	                                            \"/servlets/servlet/RequestParamExample\"	                                        ]	                                    }	                                },	                                \"async.Async0\": {	                                    \"des\": {	                                        \"name\": \"async0\",	                                        \"asyncSupported\": \"true\",	                                        \"urlPatterns\": [	                                            \"/async/async0\"	                                        ]	                                    }	                                },	                                \"async.Async1\": {	                                    \"des\": {	                                        \"name\": \"async1\",	                                        \"asyncSupported\": \"true\",	                                        \"urlPatterns\": [	                                            \"/async/async1\"	                                        ]	                                    }	                                },	                                \"chat.ChatServlet\": {	                                    \"des\": {	                                        \"name\": \"ChatServlet\",	                                        \"urlPatterns\": [	                                            \"/servlets/chat/chat\"	                                        ]	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {	                                \"org.apache.catalina.filters.RequestDumperFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"Request Dumper Filter\",	                                        \"urlPatterns\": []	                                    }	                                },	                                \"org.apache.catalina.filters.SetCharacterEncodingFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"Set Character Encoding\",	                                        \"urlPatterns\": []	                                    }	                                },	                                \"filters.ExampleFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"Timing filter\",	                                        \"urlPatterns\": []	                                    }	                                },	                                \"compressionFilters.CompressionFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"Compression Filter\",	                                        \"urlPatterns\": []	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {	                                \"websocket.drawboard.DrawboardContextListener\": {	                                    \"des\": {}	                                },	                                \"listeners.SessionListener\": {	                                    \"des\": {}	                                },	                                \"listeners.ContextListener\": {	                                    \"des\": {}	                                }	                            }	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"Servlet and JSP Examples\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/examples\",	                                \"appurl\": \"http://192.168.99.1:8080/examples/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ],	            \"host-manager\": [	                {	                    \"Instances\": [	                        {	                            \"id\": \"lib\",	                            \"values\": {}	                        }	                    ],	                    \"PEId\": \"jars\"	                },	                {	                    \"Instances\": [	                        {	                            \"id\": \"javax.servlet.annotation.WebServlet\",	                            \"values\": {	                                \"org.apache.catalina.manager.host.HTMLHostManagerServlet\": {	                                    \"des\": {	                                        \"name\": \"HTMLHostManager\",	                                        \"urlPatterns\": [	                                            \"/html/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.manager.host.HostManagerServlet\": {	                                    \"des\": {	                                        \"name\": \"HostManager\",	                                        \"urlPatterns\": [	                                            \"/text/*\"	                                        ]	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebFilter\",	                            \"values\": {	                                \"org.apache.catalina.filters.SetCharacterEncodingFilter\": {	                                    \"des\": {	                                        \"servletNames\": [],	                                        \"filterName\": \"SetCharacterEncoding\",	                                        \"urlPatterns\": [	                                            \"/*\"	                                        ]	                                    }	                                },	                                \"org.apache.catalina.filters.CsrfPreventionFilter\": {	                                    \"des\": {	                                        \"servletNames\": [	                                            \"HTMLHostManager\"	                                        ],	                                        \"filterName\": \"CSRF\",	                                        \"urlPatterns\": []	                                    }	                                }	                            }	                        },	                        {	                            \"id\": \"javax.servlet.annotation.WebListener\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.jws.WebService\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.xml.ws.WebServiceProvider\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"javax.ws.rs.Path\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"org.springframework.stereotype.Controller\",	                            \"values\": {}	                        },	                        {	                            \"id\": \"webapp\",	                            \"values\": {	                                \"appname\": \"Tomcat Host Manager Application\",	                                \"webapproot\": \"E:/ZZ/UnionAppServer/Tomcat/bin/apache-tomcat-7.0.65/webapps/host-manager\",	                                \"appurl\": \"http://192.168.99.1:8080/host-manager/\"	                            }	                        }	                    ],	                    \"PEId\": \"cpt\"	                },	                {	                    \"Instances\": [],	                    \"PEId\": \"logs\"	                }	            ]	        }	    }";
    MonitorDataFrame mdf = new MonitorDataFrame(test);
    System.out.println(mdf.toJSONString());
}
Also used : MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame)

Example 5 with MonitorDataFrame

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

the class RuntimeNotifyCatcher method pushToSliceQueues.

/**
 * pushToSliceQueues
 *
 * @param string
 */
private void pushToSliceQueues(String jsonStr, boolean needConcurrent) {
    List<String> mdfJsonList = JSONHelper.toObjectArray(jsonStr, String.class);
    for (String mdfJson : mdfJsonList) {
        MonitorDataFrame mdf = new MonitorDataFrame(mdfJson);
        pushToSliceQueue(mdf, needConcurrent);
    }
}
Also used : MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame)

Aggregations

MonitorDataFrame (com.creditease.agent.monitor.api.MonitorDataFrame)18 ArrayList (java.util.ArrayList)13 List (java.util.List)8 Map (java.util.Map)8 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)4 AppServerProfileDataCatchWorker (com.creditease.agent.feature.monitoragent.AppServerProfileDataCatchWorker)3 IOException (java.io.IOException)2 JSONArray (com.alibaba.fastjson.JSONArray)1 JSONObject (com.alibaba.fastjson.JSONObject)1 ISystemLogger (com.creditease.agent.log.api.ISystemLogger)1 StandardMonitorRepository (com.creditease.agent.monitor.api.StandardMonitorRepository)1 StandardProfileModeler (com.creditease.agent.profile.api.StandardProfileModeler)1 ActionContext (com.creditease.agent.spi.ActionContext)1 AgentFeatureComponent (com.creditease.agent.spi.AgentFeatureComponent)1 IActionEngine (com.creditease.agent.spi.IActionEngine)1 ISystemActionEngineMgr (com.creditease.agent.spi.ISystemActionEngineMgr)1 CacheManager (com.creditease.uav.cache.api.CacheManager)1 Message (com.creditease.uav.messaging.api.Message)1 MessageProducer (com.creditease.uav.messaging.api.MessageProducer)1