Search in sources :

Example 1 with ApplicationMapWithScatterData

use of com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData in project pinpoint by naver.

the class FilteredMapServiceImpl method selectApplicationMapWithScatterData.

@Override
public ApplicationMap selectApplicationMapWithScatterData(List<TransactionId> transactionIdList, Range originalRange, Range scanRange, int xGroupUnit, int yGroupUnit, 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);
    ApplicationMapWithScatterData applicationMapWithScatterData = new ApplicationMapWithScatterData(map, dotExtractor.getApplicationScatterData(originalRange.getFrom(), originalRange.getTo(), xGroupUnit, yGroupUnit));
    watch.stop();
    logger.debug("Select filtered application map elapsed. {}ms", watch.getTotalTimeMillis());
    return applicationMapWithScatterData;
}
Also used : ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData) ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) ArrayList(java.util.ArrayList) List(java.util.List) StopWatch(org.springframework.util.StopWatch)

Example 2 with ApplicationMapWithScatterData

use of com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData in project pinpoint by naver.

the class FilteredMapServiceImpl method selectApplicationMapWithScatterData.

public ApplicationMap selectApplicationMapWithScatterData(FilteredMapServiceOption option) {
    StopWatch watch = new StopWatch();
    watch.start();
    final List<List<SpanBo>> filterList = selectFilteredSpan(option.getTransactionIdList(), option.getFilter(), option.getColumnGetCount());
    FilteredMapBuilder filteredMapBuilder = new FilteredMapBuilder(applicationFactory, registry, option.getOriginalRange(), option.getVersion());
    filteredMapBuilder.serverMapDataFilter(serverMapDataFilter);
    filteredMapBuilder.addTransactions(filterList);
    FilteredMap filteredMap = filteredMapBuilder.build();
    ApplicationMap map = createMap(option, filteredMap);
    Map<Application, ScatterData> applicationScatterData = filteredMap.getApplicationScatterData(option.getOriginalRange().getFrom(), option.getOriginalRange().getTo(), option.getxGroupUnit(), option.getyGroupUnit());
    ApplicationMapWithScatterData applicationMapWithScatterData = new ApplicationMapWithScatterData(map, applicationScatterData);
    watch.stop();
    logger.debug("Select filtered application map elapsed. {}ms", watch.getTotalTimeMillis());
    return applicationMapWithScatterData;
}
Also used : ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData) ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) FilteredMapBuilder(com.navercorp.pinpoint.web.service.map.FilteredMapBuilder) ArrayList(java.util.ArrayList) List(java.util.List) Application(com.navercorp.pinpoint.web.vo.Application) FilteredMap(com.navercorp.pinpoint.web.service.map.FilteredMap) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData) StopWatch(org.springframework.util.StopWatch)

Example 3 with ApplicationMapWithScatterData

use of com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData 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 = Node.createNodeName(application);
            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 = Node.createNodeName(application);
            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();
}
Also used : ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData) ApplicationMapWithScatterScanResult(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult) ApplicationScatterScanResult(com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult) Application(com.navercorp.pinpoint.web.vo.Application) Map(java.util.Map) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) ApplicationMapWithScatterData(com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData)

Aggregations

ApplicationMapWithScatterData (com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData)3 ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)2 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)2 Application (com.navercorp.pinpoint.web.vo.Application)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 StopWatch (org.springframework.util.StopWatch)2 ApplicationMapWithScatterScanResult (com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult)1 FilteredMap (com.navercorp.pinpoint.web.service.map.FilteredMap)1 FilteredMapBuilder (com.navercorp.pinpoint.web.service.map.FilteredMapBuilder)1 ApplicationScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult)1 Map (java.util.Map)1