use of com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult in project pinpoint by naver.
the class FilterMapWrapSerializer method serialize.
@Override
public void serialize(FilterMapWrap wrap, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
jgen.writeObjectField("applicationMapData", wrap.getApplicationMap());
jgen.writeNumberField("lastFetchedTimestamp", wrap.getLastFetchedTimestamp());
if (wrap.getApplicationMap() instanceof ApplicationMapWithScatterScanResult) {
final List<ApplicationScatterScanResult> applicationScatterScanResult = ((ApplicationMapWithScatterScanResult) wrap.getApplicationMap()).getApplicationScatterScanResultList();
jgen.writeFieldName("applicationScatterScanResult");
jgen.writeStartObject();
for (ApplicationScatterScanResult scatterScanResult : applicationScatterScanResult) {
Application application = scatterScanResult.getApplication();
String name = application.getName() + Node.NODE_DELIMITER + application.getServiceType().toString();
jgen.writeObjectField(name, scatterScanResult.getScatterScanResult());
}
jgen.writeEndObject();
}
if (wrap.getApplicationMap() instanceof ApplicationMapWithScatterData) {
Map<Application, ScatterData> applicationScatterDataMap = ((ApplicationMapWithScatterData) wrap.getApplicationMap()).getApplicationScatterDataMap();
jgen.writeFieldName("applicationScatterData");
jgen.writeStartObject();
for (Map.Entry<Application, ScatterData> entry : applicationScatterDataMap.entrySet()) {
Application application = entry.getKey();
String name = application.getName() + Node.NODE_DELIMITER + application.getServiceType().toString();
jgen.writeFieldName(name);
ScatterData scatterData = entry.getValue();
jgen.writeStartObject();
jgen.writeObjectField("from", scatterData.getFrom());
jgen.writeObjectField("to", scatterData.getTo());
jgen.writeObjectField("resultFrom", scatterData.getOldestAcceptedTime());
jgen.writeObjectField("resultTo", scatterData.getLatestAcceptedTime());
jgen.writeObjectField("scatter", scatterData);
jgen.writeEndObject();
}
jgen.writeEndObject();
}
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult in project pinpoint by naver.
the class FilteredMapServiceImpl method selectApplicationMap.
/**
* filtered application map
*/
@Override
public ApplicationMap selectApplicationMap(List<TransactionId> transactionIdList, Range originalRange, Range scanRange, Filter filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
StopWatch watch = new StopWatch();
watch.start();
final List<List<SpanBo>> filterList = selectFilteredSpan(transactionIdList, filter);
DotExtractor dotExtractor = createDotExtractor(scanRange, filterList);
ApplicationMap map = createMap(originalRange, scanRange, filterList);
ApplicationMapWithScatterScanResult applicationMapWithScatterScanResult = new ApplicationMapWithScatterScanResult(map, dotExtractor.getApplicationScatterScanResult());
watch.stop();
logger.debug("Select filtered application map elapsed. {}ms", watch.getTotalTimeMillis());
return applicationMapWithScatterScanResult;
}
Aggregations