[강운덕] [WEB-57] TimeSeriesStore 관련 class 제거

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@3429 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2014-03-10 02:56:50 +00:00
parent c4a7537fa2
commit 78e36ecfa1
6 changed files with 3 additions and 128 deletions
@@ -26,8 +26,6 @@ public class ApplicationMap {
private final Set<String> applicationNames = new HashSet<String>();
private final Range range;
private TimeSeriesStore timeSeriesStore;
ApplicationMap(Range range) {
if (range == null) {
@@ -69,14 +67,6 @@ public class ApplicationMap {
}
public TimeSeriesStore getTimeSeriesStore() {
return timeSeriesStore;
}
public void setTimeSeriesStore(TimeSeriesStore timeSeriesStore) {
this.timeSeriesStore = timeSeriesStore;
}
public void buildNode() {
this.nodeList.build();
}
@@ -77,9 +77,6 @@ public class FilteredMapController {
model.addAttribute("nodes", map.getNodes());
model.addAttribute("links", map.getLinks());
// FIXME linkstatistics detail에 보여주는 timeseries값을 서버맵에서 제공할 예정.
model.addAttribute("timeseriesResponses", map.getTimeSeriesStore());
return "applicationmap.filtered";
}
@@ -197,7 +197,6 @@ public class FilteredMapServiceImpl implements FilteredMapService {
final Map<LinkKey, LinkStatistics> linkStatMap = new HashMap<LinkKey, LinkStatistics>();
final TimeSeriesStore timeSeriesStore = new DefaultTimeSeriesStoreImpl(range);
final MapResponseHistogramSummary mapHistogramSummary = new MapResponseHistogramSummary(range);
/**
* 통계정보로 변환한다.
@@ -230,14 +229,8 @@ public class FilteredMapServiceImpl implements FilteredMapService {
long timestamp = window.refineTimestamp(span.getCollectorAcceptTime());
linkStat.addCallData(span.getAgentId(), srcApplication.getServiceTypeCode(), destApplication.getName(), destApplication.getServiceTypeCode(), timestamp, slotTime, 1);
// link timeseries statistics추가.
timeSeriesStore.addLinkStat(linkKey, span.getCollectorAcceptTime(), slotTime, 1L, span.hasException());
// application timeseries statistics
Application node = new Application(span.getApplicationId(), span.getServiceType());
timeSeriesStore.addNodeStat(node, span.getCollectorAcceptTime(), slotTime, 1L, span.hasException());
addNodeFromSpanEvent(span, window, linkStatMap, timeSeriesStore, transactionSpanMap);
addNodeFromSpanEvent(span, window, linkStatMap, transactionSpanMap);
}
}
@@ -249,7 +242,6 @@ public class FilteredMapServiceImpl implements FilteredMapService {
Collection<LinkStatistics> linkStatisticsList = linkStatMap.values();
ApplicationMapBuilder applicationMapBuilder = new ApplicationMapBuilder(range);
ApplicationMap map = applicationMapBuilder.build(linkStatisticsList);
map.setTimeSeriesStore(timeSeriesStore);
mapHistogramSummary.build();
map.appendResponseTime(mapHistogramSummary);
@@ -274,7 +266,7 @@ public class FilteredMapServiceImpl implements FilteredMapService {
}
private void addNodeFromSpanEvent(SpanBo span, TimeWindow window, Map<LinkKey, LinkStatistics> linkStatMap, TimeSeriesStore timeSeriesStore, Map<Long, SpanBo> transactionSpanMap) {
private void addNodeFromSpanEvent(SpanBo span, TimeWindow window, Map<LinkKey, LinkStatistics> linkStatMap, Map<Long, SpanBo> transactionSpanMap) {
/**
* span event의 statistics추가.
*/
@@ -318,12 +310,6 @@ public class FilteredMapServiceImpl implements FilteredMapService {
final long spanEventTimeStamp = window.refineTimestamp(span.getStartTime() + spanEvent.getStartElapsed());
linkData.addCallData(span.getAgentId(), span.getServiceType().getCode(), spanEvent.getEndPoint(), destServiceType.getCode(), spanEventTimeStamp, slotTime, 1);
// link timeseries statistics추가.
timeSeriesStore.addLinkStat(spanEventStatKey, spanEventTimeStamp, slotTime, 1L, spanEvent.hasException());
// application timeseries statistics
Application nodeKey = new Application(spanEvent.getDestinationId(), spanEvent.getServiceType());
timeSeriesStore.addNodeStat(nodeKey, span.getCollectorAcceptTime(), slotTime, 1L, spanEvent.hasException());
}
}
@@ -1,82 +0,0 @@
package com.nhn.pinpoint.web.vo;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author netspider
*
*/
@Deprecated
public class DefaultTimeSeriesStoreImpl implements TimeSeriesStore {
private static final String EMPTY = "{}";
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Range range;
private final Map<LinkKey, LoadFactor> linkData = new HashMap<LinkKey, LoadFactor>();
private final Map<Application, LoadFactor> nodeData = new HashMap<Application, LoadFactor>();
private final boolean enabled;
public DefaultTimeSeriesStoreImpl(Range range) {
if (range == null) {
throw new NullPointerException("range must not be null");
}
this.range = range;
this.enabled = range.getFrom() == -1L || range.getTo() == -1L;
}
@Override
public void addLinkStat(LinkKey linkKey, long timeStamp, int responseTimeSlot, long callCount, boolean isFailed) {
if (linkKey == null) {
throw new NullPointerException("linkKey must not be null");
}
if (!enabled) {
return;
}
logger.debug("add sample linkKey={}, timeStamp={} responseTimeSlot={}, count={}", linkKey, timeStamp, responseTimeSlot, callCount, isFailed);
LoadFactor stat = linkData.get(linkKey);
if (stat == null) {
stat = new LoadFactor(range);
linkData.put(linkKey, stat);
}
stat.addSample(timeStamp, responseTimeSlot, callCount, isFailed);
}
@Override
public void addNodeStat(Application nodeKey, long timeStamp, int responseTimeSlot, long callCount, boolean isFailed) {
if (nodeKey == null) {
throw new NullPointerException("nodeKey must not be null");
}
if (!enabled) {
return;
}
logger.debug("add sample nodeKey={}, timeStamp={} responseTimeSlot={}, count={}", nodeKey, timeStamp, responseTimeSlot, callCount, isFailed);
LoadFactor stat = nodeData.get(nodeKey);
if (stat == null) {
stat = new LoadFactor(range);
nodeData.put(nodeKey, stat);
}
stat.addSample(timeStamp, responseTimeSlot, callCount, isFailed);
}
@Override
public String getJson() {
if (!enabled) {
logger.debug("store is not enabled. there's no data.");
return EMPTY;
}
return "{}";
}
}
@@ -1,15 +0,0 @@
package com.nhn.pinpoint.web.vo;
import com.nhn.pinpoint.web.util.JsonSerializable;
/**
*
* @author netspider
*
*/
@Deprecated
public interface TimeSeriesStore extends JsonSerializable {
void addLinkStat(LinkKey key, long timestamp, int responseTimeslot, long callCount, boolean isFailed);
void addNodeStat(Application key, long timestamp, int responseTimeslot, long callCount, boolean isFailed);
}
@@ -98,6 +98,5 @@
} <c:if test="${!status.last}">,</c:if>
</c:forEach>
]
},
"timeSeriesResponses" : ${timeseriesResponses.json}
}
}