public static void send(SummaryPack p) { p.objHash = conf.getObjHash(); p.objType = conf.obj_type; sendDirect(p); } static DataUdpAgent udpNet = DataUdpAgent.getInstance();
public static void send(SummaryPack p) { p.objHash = conf.getObjHash(); p.objType = conf.obj_type; sendDirect(p); } static DataUdpAgent udpNet = DataUdpAgent.getInstance();
public static void sendAlert(byte level, String title, String message, MapValue tags) { AlertPack p = new AlertPack(); p.objType = conf.obj_type; p.objHash = conf.getObjHash(); p.level = level; p.title = title; p.message = message; if (tags != null) { p.tags = tags; } sendDirect(p); }
public static void sendProfile(List<Step> p, TraceContext x) { if (p == null || p.size() == 0) return; XLogProfilePack pk = new XLogProfilePack(); pk.txid = x.txid; pk.objHash = conf.getObjHash(); pk.profile = Step.toBytes(p); x.profileCount += p.size(); // udp.add(pk); sendDirect(pk); }
public static void sendAlert(byte level, String title, String message, MapValue tags) { AlertPack p = new AlertPack(); p.objType = conf.obj_type; p.objHash = conf.getObjHash(); p.level = level; p.title = title; p.message = message; if (tags != null) { p.tags = tags; } sendDirect(p); } private static IntLinkedSet errText = new IntLinkedSet().setMax(10000);
public static void sendProfile(List<Step> p, TraceContext x) { if (p == null || p.size() == 0) return; XLogProfilePack pk = new XLogProfilePack(); pk.txid = x.txid; pk.objHash = conf.getObjHash(); pk.profile = Step.toBytes(p); x.profileCount += p.size(); // udp.add(pk); sendDirect(pk); }
public static void sendAlert(byte level, String title, String message, MapValue tags) { AlertPack p = new AlertPack(); p.objType = conf.obj_type; p.objHash = conf.getObjHash(); p.level = level; p.title = title; p.message = message; if (tags != null) { p.tags = tags; } sendDirect(p); } private static IntLinkedSet errText = new IntLinkedSet().setMax(10000);
public static void sendProfile(Step[] p, TraceContext context) { if (p == null || p.length == 0) return; XLogProfilePack pk = new XLogProfilePack(); pk.txid = context.txid; pk.objHash = conf.getObjHash(); pk.profile = Step.toBytes(p); pk.service = context.serviceHash; pk.elapsed = (int) (System.currentTimeMillis() - context.startTime); context.profileCount += p.length; sendDirect(pk); } public static void sendProfile(List<Step> p, TraceContext x) {
public static void sendProfile(Step[] p, TraceContext context) { if (p == null || p.length == 0) return; XLogProfilePack pk = new XLogProfilePack(); pk.txid = context.txid; pk.objHash = conf.getObjHash(); pk.profile = Step.toBytes(p); pk.service = context.serviceHash; pk.elapsed = (int) (System.currentTimeMillis() - context.startTime); context.profileCount += p.length; sendDirect(pk); } public static void sendProfile(List<Step> p, TraceContext x) {
private void transfer(TraceContext ctx, HttpURLConnection urlCon, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } try { urlCon.setRequestProperty(conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); urlCon.setRequestProperty(conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); urlCon.setRequestProperty(conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); urlCon.setRequestProperty(conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); PluginHttpCallTrace.call(ctx, urlCon); } catch (Throwable t) { } } }
public static void sendXLog(XLogPack p) { p.objHash = conf.getObjHash(); sendDirect(p); if (conf._log_udp_xlog_enabled) { Logger.println(p.toString()); } } public static void send(SummaryPack p) {
public static void sendXLog(XLogPack p) { p.objHash = conf.getObjHash(); sendDirect(p); if (conf._log_udp_xlog_enabled) { Logger.println(p.toString()); } } public static void send(SummaryPack p) {
@RequestHandler(RequestCmd.OBJECT_INFO) public Pack getAgentInfo(Pack param) { MapPack p = new MapPack(); p.put("objHash", conf.getObjHash()); p.put("objName", conf.getObjName()); p.put("java.version", System.getProperty("java.version")); p.put("os.name", System.getProperty("os.name")); p.put("user.home", System.getProperty("user.home")); p.put("work.dir", new File(".").getAbsolutePath()); return p; }
@RequestHandler(RequestCmd.OBJECT_INFO) public Pack getAgentInfo(Pack param) { MapPack p = new MapPack(); p.put("objHash", conf.getObjHash()); p.put("objName", conf.getObjName()); p.put("java.version", System.getProperty("java.version")); p.put("os.name", System.getProperty("os.name")); p.put("user.home", System.getProperty("user.home")); p.put("work.dir", new File(".").getAbsolutePath()); return p; }
private static void meteringInteraction0(TraceContext ctx, XLogPack pack) { if (conf.counter_interaction_enabled) { if (ctx.callerObjHash != 0) { MeterInteraction meterInteraction = MeterInteractionManager.getInstance() .getApiIncomingMeter(ctx.callerObjHash, conf.getObjHash()); if (meterInteraction != null) { meterInteraction.add(pack.elapsed, pack.error > 0); } } else { MeterInteraction meterInteraction = MeterInteractionManager.getInstance() .getNormalIncomingMeter(0, conf.getObjHash()); if (meterInteraction != null) { meterInteraction.add(pack.elapsed, pack.error > 0); } } } }
private void writeMTU(long pkid, int total, int num, int packetSize, byte[] data) throws IOException { DataOutputX out = new DataOutputX(); out.write(NetCafe.CAFE_MTU); out.writeInt(conf.getObjHash()); out.writeLong(pkid); out.writeShort(total); out.writeShort(num); out.writeBlob(data); byte[] buff = out.toByteArray(); DatagramPacket packet = new DatagramPacket(buff, buff.length); packet.setAddress(server_host); packet.setPort(server_port); datagram.send(packet); }
private void writeMTU(long pkid, int total, int num, int packetSize, byte[] data) throws IOException { DataOutputX out = new DataOutputX(); out.write(NetCafe.CAFE_MTU); out.writeInt(conf.getObjHash()); out.writeLong(pkid); out.writeShort(total); out.writeShort(num); out.writeBlob(data); byte[] buff = out.toByteArray(); DatagramPacket packet = new DatagramPacket(buff, buff.length); packet.setAddress(server_host); packet.setPort(server_port); datagram.send(packet); } public void close() {
private void writeMTU(long pkid, int total, int num, int packetSize, byte[] data) throws IOException { DataOutputX out = new DataOutputX(); out.write(NetCafe.CAFE_MTU); out.writeInt(conf.getObjHash()); out.writeLong(pkid); out.writeShort(total); out.writeShort(num); out.writeBlob(data); byte[] buff = out.toByteArray(); DatagramPacket packet = new DatagramPacket(buff, buff.length); packet.setAddress(server_host); packet.setPort(server_port); datagram.send(packet); } public void close() {
private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { try { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } httpclient.addHeader(req, conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); httpclient.addHeader(req, conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); PluginHttpCallTrace.call(ctx, httpclient, req); } catch (Exception e) { } } }
private ObjectPack getMainObject() { Configure conf = Configure.getInstance(); ObjectPack p = new ObjectPack(); p.objType = conf.obj_type; p.objHash = conf.getObjHash(); p.objName = conf.getObjName(); p.version = Version.getAgentFullVersion(); p.address = TcpWorker.localAddr; if(StringUtil.isNotEmpty(conf.getObjDetectedType())){ p.tags.put(TAG_OBJ_DETECTED_TYPE, conf.getObjDetectedType()); } return p; }