use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.
the class MapStatisticsCallerDataCollector method getCount.
public long getCount(String calleName, DataCategory dataCategory) {
LinkCallData linkCallData = calleStatMap.get(calleName);
long count = 0;
if (linkCallData != null) {
switch(dataCategory) {
case SLOW_COUNT:
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
count += timeHistogram.getSlowCount();
count += timeHistogram.getVerySlowCount();
}
break;
case ERROR_COUNT:
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
count += timeHistogram.getTotalErrorCount();
}
break;
case TOTAL_COUNT:
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
count += timeHistogram.getTotalCount();
}
break;
default:
throw new IllegalArgumentException("Can't count for " + dataCategory.toString());
}
return count;
}
return 0;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.
the class MapStatisticsCallerDataCollector method collect.
@Override
public void collect() {
if (init.get()) {
return;
}
LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, new Range(timeSlotEndTime - slotInterval, timeSlotEndTime));
for (LinkData linkData : callerDataMap.getLinkDataList()) {
LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
calleStatMap.put(linkCallData.getTarget(), linkCallData);
}
}
init.set(true);
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.
the class MapStatisticsCallerDataCollector method getCountRate.
public long getCountRate(String calleName, DataCategory dataCategory) {
LinkCallData linkCallData = calleStatMap.get(calleName);
long count = 0;
long totalCount = 0;
if (linkCallData != null) {
switch(dataCategory) {
case SLOW_RATE:
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
count += timeHistogram.getSlowCount();
count += timeHistogram.getVerySlowCount();
totalCount += timeHistogram.getTotalCount();
}
break;
case ERROR_RATE:
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
count += timeHistogram.getTotalErrorCount();
totalCount += timeHistogram.getTotalCount();
}
break;
default:
throw new IllegalArgumentException("Can't calculate rate for " + dataCategory.toString());
}
return calculatePercent(count, totalCount);
}
return 0;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData in project pinpoint by naver.
the class ApplicationTimeHistogramBuilder method build.
public ApplicationTimeHistogram build(Collection<LinkCallData> linkCallDataMapList) {
Map<Long, TimeHistogram> applicationLevelHistogram = new HashMap<>();
for (LinkCallData linkCallData : linkCallDataMapList) {
for (TimeHistogram timeHistogram : linkCallData.getTimeHistogram()) {
Long timeStamp = timeHistogram.getTimeStamp();
TimeHistogram histogram = applicationLevelHistogram.get(timeStamp);
if (histogram == null) {
histogram = new TimeHistogram(timeHistogram.getHistogramSchema(), timeStamp);
applicationLevelHistogram.put(timeStamp, histogram);
}
histogram.add(timeHistogram);
}
}
List<TimeHistogram> histogramList = interpolation(applicationLevelHistogram.values());
if (logger.isTraceEnabled()) {
for (TimeHistogram histogram : histogramList) {
logger.trace("applicationLevel histogram:{}", histogram);
}
}
ApplicationTimeHistogram applicationTimeHistogram = new ApplicationTimeHistogram(application, range, histogramList);
return applicationTimeHistogram;
}
Aggregations