Search in sources :

Example 1 with ScatterData

use of com.navercorp.pinpoint.web.scatter.ScatterData in project pinpoint by naver.

the class ScatterChartController method selectScatterData.

private ModelAndView selectScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean backwardDirection, int version) {
    ModelAndView mv = null;
    if (version == 1) {
        final ScatterData scatterData = scatter.selectScatterData(applicationName, range, xGroupUnit, yGroupUnit, limit, backwardDirection);
        boolean requestComplete = scatterData.getDotSize() < limit;
        mv = createScatterDataV1(scatterData, requestComplete);
    } else {
        mv = new ModelAndView();
    }
    mv.addObject("currentServerTime", new ServerTime().getCurrentServerTime());
    mv.addObject("from", range.getFrom());
    mv.addObject("to", range.getTo());
    return mv;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) ServerTime(com.navercorp.pinpoint.web.view.ServerTime) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData)

Example 2 with ScatterData

use of com.navercorp.pinpoint.web.scatter.ScatterData in project pinpoint by naver.

the class ScatterChartController method selectFilterScatterData.

private ModelAndView selectFilterScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean backwardDirection, String filterText, int version) {
    final LimitedScanResult<List<TransactionId>> limitedScanResult = flow.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit, backwardDirection);
    final List<TransactionId> transactionIdList = limitedScanResult.getScanData();
    logger.trace("submitted transactionId count={}", transactionIdList.size());
    boolean requestComplete = transactionIdList.size() < limit;
    Collections.sort(transactionIdList, TransactionIdComparator.INSTANCE);
    Filter filter = filterBuilder.build(filterText);
    ModelAndView mv;
    if (version == 1) {
        ScatterData scatterData = scatter.selectScatterData(transactionIdList, applicationName, range, xGroupUnit, yGroupUnit, filter);
        if (logger.isDebugEnabled()) {
            logger.debug("getScatterData range scan(limited:{}, backwardDirection:{}) from ~ to:{} ~ {}, limited:{}, filterDataSize:{}", limit, backwardDirection, DateUtils.longToDateStr(range.getFrom()), DateUtils.longToDateStr(range.getTo()), DateUtils.longToDateStr(limitedScanResult.getLimitedTime()), transactionIdList.size());
        }
        mv = createScatterDataV1(scatterData, requestComplete);
    } else {
        mv = new ModelAndView();
    }
    mv.addObject("currentServerTime", new ServerTime().getCurrentServerTime());
    mv.addObject("from", range.getFrom());
    mv.addObject("to", range.getTo());
    return mv;
}
Also used : Filter(com.navercorp.pinpoint.web.filter.Filter) ModelAndView(org.springframework.web.servlet.ModelAndView) List(java.util.List) ServerTime(com.navercorp.pinpoint.web.view.ServerTime) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 3 with ScatterData

use of com.navercorp.pinpoint.web.scatter.ScatterData 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();
}
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)

Example 4 with ScatterData

use of com.navercorp.pinpoint.web.scatter.ScatterData in project pinpoint by naver.

the class DotExtractor method getApplicationScatterData.

public Map<Application, ScatterData> getApplicationScatterData(long from, long to, int xGroupUnitMillis, int yGroupUnitMillis) {
    Map<Application, ScatterData> applicationScatterDataMap = new HashMap<>();
    for (Map.Entry<Application, List<Dot>> entry : this.dotMap.entrySet()) {
        Application application = entry.getKey();
        List<Dot> dotList = entry.getValue();
        ScatterData scatterData = new ScatterData(from, to, xGroupUnitMillis, yGroupUnitMillis);
        scatterData.addDot(dotList);
        applicationScatterDataMap.put(application, scatterData);
    }
    return applicationScatterDataMap;
}
Also used : HashMap(java.util.HashMap) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData)

Example 5 with ScatterData

use of com.navercorp.pinpoint.web.scatter.ScatterData in project pinpoint by naver.

the class ScatterChartServiceImpl method selectScatterData.

@Override
public ScatterData selectScatterData(List<TransactionId> transactionIdList, String applicationName, Range range, int xGroupUnit, int yGroupUnit, Filter filter) {
    if (transactionIdList == null) {
        throw new NullPointerException("transactionIdList must not be null");
    }
    if (applicationName == null) {
        throw new NullPointerException("applicationName must not be null");
    }
    if (filter == null) {
        throw new NullPointerException("filter must not be null");
    }
    final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
    ScatterData scatterData = new ScatterData(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
    for (List<SpanBo> trace : traceList) {
        if (!filter.include(trace)) {
            continue;
        }
        for (SpanBo span : trace) {
            if (applicationName.equals(span.getApplicationId())) {
                final TransactionId transactionId = span.getTransactionId();
                final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
                scatterData.addDot(dot);
            }
        }
    }
    return scatterData;
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) ArrayList(java.util.ArrayList) List(java.util.List) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Aggregations

ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)7 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)3 List (java.util.List)3 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)2 ServerTime (com.navercorp.pinpoint.web.view.ServerTime)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 ModelAndView (org.springframework.web.servlet.ModelAndView)2 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)1 ApplicationMapWithScatterData (com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterData)1 ApplicationMapWithScatterScanResult (com.navercorp.pinpoint.web.applicationmap.ApplicationMapWithScatterScanResult)1 Filter (com.navercorp.pinpoint.web.filter.Filter)1 TraceIndexScatterMapper3 (com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper3)1 Application (com.navercorp.pinpoint.web.vo.Application)1 ApplicationScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult)1 HashMap (java.util.HashMap)1 Cell (org.apache.hadoop.hbase.Cell)1 Scan (org.apache.hadoop.hbase.client.Scan)1