use of com.navercorp.pinpoint.web.applicationmap.link.MatcherGroup in project pinpoint by naver.
the class ServerInstanceListSerializer method serialize.
@Override
public void serialize(ServerInstanceList serverInstanceList, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
Map<String, List<ServerInstance>> map = serverInstanceList.getServerInstanceList();
for (Map.Entry<String, List<ServerInstance>> entry : map.entrySet()) {
jgen.writeFieldName(entry.getKey());
jgen.writeStartObject();
jgen.writeStringField("name", entry.getKey());
jgen.writeStringField("status", null);
if (matcherGroupList != null) {
jgen.writeFieldName("linkList");
jgen.writeStartArray();
for (MatcherGroup matcherGroup : matcherGroupList) {
if (matcherGroup.ismatchingType(entry.getValue().get(0))) {
LinkInfo linkInfo = matcherGroup.makeLinkInfo(entry.getValue().get(0));
jgen.writeStartObject();
jgen.writeStringField("linkName", linkInfo.getLinkName());
jgen.writeStringField("linkURL", linkInfo.getLinkUrl());
jgen.writeStringField("linkType", linkInfo.getLinktype());
jgen.writeEndObject();
}
}
jgen.writeEndArray();
}
jgen.writeFieldName("instanceList");
writeInstanceList(jgen, entry.getValue());
jgen.writeEndObject();
}
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.applicationmap.link.MatcherGroup in project pinpoint by naver.
the class AgentInfoSerializer method serialize.
@Override
public void serialize(AgentInfo agentInfo, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
jgen.writeStringField("applicationName", agentInfo.getApplicationName());
jgen.writeStringField("agentId", agentInfo.getAgentId());
jgen.writeNumberField("startTimestamp", agentInfo.getStartTimestamp());
jgen.writeStringField("hostName", agentInfo.getHostName());
jgen.writeStringField("ip", agentInfo.getIp());
jgen.writeStringField("ports", agentInfo.getPorts());
final ServiceType serviceType = serviceTypeRegistryService.findServiceType(agentInfo.getServiceTypeCode());
jgen.writeStringField("serviceType", serviceType.getDesc());
jgen.writeNumberField("pid", agentInfo.getPid());
jgen.writeStringField("vmVersion", agentInfo.getVmVersion());
jgen.writeStringField("agentVersion", agentInfo.getAgentVersion());
jgen.writeObjectField("serverMetaData", agentInfo.getServerMetaData());
jgen.writeObjectField("jvmInfo", agentInfo.getJvmInfo());
AgentStatus status = agentInfo.getStatus();
if (status != null) {
jgen.writeObjectField("status", status);
}
jgen.writeNumberField("initialStartTimestamp", agentInfo.getInitialStartTimestamp());
if (matcherGroupList != null) {
jgen.writeFieldName("linkList");
jgen.writeStartArray();
for (MatcherGroup matcherGroup : matcherGroupList) {
if (matcherGroup.ismatchingType(agentInfo)) {
LinkInfo linkInfo = matcherGroup.makeLinkInfo(agentInfo);
jgen.writeStartObject();
jgen.writeStringField("linkName", linkInfo.getLinkName());
jgen.writeStringField("linkURL", linkInfo.getLinkUrl());
jgen.writeStringField("linkType", linkInfo.getLinktype());
jgen.writeEndObject();
}
}
jgen.writeEndArray();
}
jgen.writeEndObject();
}
Aggregations