From 78e36ecfa13b1de4df5e72ef1ff201359fab0c0b Mon Sep 17 00:00:00 2001 From: Woonduk Kang Date: Mon, 10 Mar 2014 02:56:50 +0000 Subject: [PATCH] =?UTF-8?q?[=EA=B0=95=EC=9A=B4=EB=8D=95]=20[WEB-57]=20Time?= =?UTF-8?q?SeriesStore=20=EA=B4=80=EB=A0=A8=20class=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@3429 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../web/applicationmap/ApplicationMap.java | 10 --- .../web/controller/FilteredMapController.java | 3 - .../web/service/FilteredMapServiceImpl.java | 18 +--- .../web/vo/DefaultTimeSeriesStoreImpl.java | 82 ------------------- .../nhn/pinpoint/web/vo/TimeSeriesStore.java | 15 ---- .../WEB-INF/views/applicationmap.filtered.jsp | 3 +- 6 files changed, 3 insertions(+), 128 deletions(-) delete mode 100644 src/main/java/com/nhn/pinpoint/web/vo/DefaultTimeSeriesStoreImpl.java delete mode 100644 src/main/java/com/nhn/pinpoint/web/vo/TimeSeriesStore.java diff --git a/src/main/java/com/nhn/pinpoint/web/applicationmap/ApplicationMap.java b/src/main/java/com/nhn/pinpoint/web/applicationmap/ApplicationMap.java index e3a3f2f11..cb6094caa 100644 --- a/src/main/java/com/nhn/pinpoint/web/applicationmap/ApplicationMap.java +++ b/src/main/java/com/nhn/pinpoint/web/applicationmap/ApplicationMap.java @@ -26,8 +26,6 @@ public class ApplicationMap { private final Set applicationNames = new HashSet(); 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(); } diff --git a/src/main/java/com/nhn/pinpoint/web/controller/FilteredMapController.java b/src/main/java/com/nhn/pinpoint/web/controller/FilteredMapController.java index 1dc1cd71a..d5a63f3fb 100644 --- a/src/main/java/com/nhn/pinpoint/web/controller/FilteredMapController.java +++ b/src/main/java/com/nhn/pinpoint/web/controller/FilteredMapController.java @@ -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"; } diff --git a/src/main/java/com/nhn/pinpoint/web/service/FilteredMapServiceImpl.java b/src/main/java/com/nhn/pinpoint/web/service/FilteredMapServiceImpl.java index 682211c4b..63b9d4ad9 100755 --- a/src/main/java/com/nhn/pinpoint/web/service/FilteredMapServiceImpl.java +++ b/src/main/java/com/nhn/pinpoint/web/service/FilteredMapServiceImpl.java @@ -197,7 +197,6 @@ public class FilteredMapServiceImpl implements FilteredMapService { final Map linkStatMap = new HashMap(); - 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 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 linkStatMap, TimeSeriesStore timeSeriesStore, Map transactionSpanMap) { + private void addNodeFromSpanEvent(SpanBo span, TimeWindow window, Map linkStatMap, Map 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()); } } diff --git a/src/main/java/com/nhn/pinpoint/web/vo/DefaultTimeSeriesStoreImpl.java b/src/main/java/com/nhn/pinpoint/web/vo/DefaultTimeSeriesStoreImpl.java deleted file mode 100644 index 24041f900..000000000 --- a/src/main/java/com/nhn/pinpoint/web/vo/DefaultTimeSeriesStoreImpl.java +++ /dev/null @@ -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 linkData = new HashMap(); - private final Map nodeData = new HashMap(); - - 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 "{}"; - } - -} diff --git a/src/main/java/com/nhn/pinpoint/web/vo/TimeSeriesStore.java b/src/main/java/com/nhn/pinpoint/web/vo/TimeSeriesStore.java deleted file mode 100644 index 4ff2649aa..000000000 --- a/src/main/java/com/nhn/pinpoint/web/vo/TimeSeriesStore.java +++ /dev/null @@ -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); -} diff --git a/src/main/webapp/WEB-INF/views/applicationmap.filtered.jsp b/src/main/webapp/WEB-INF/views/applicationmap.filtered.jsp index 5ec11e193..e0b6c823e 100644 --- a/src/main/webapp/WEB-INF/views/applicationmap.filtered.jsp +++ b/src/main/webapp/WEB-INF/views/applicationmap.filtered.jsp @@ -98,6 +98,5 @@ } , ] - }, - "timeSeriesResponses" : ${timeseriesResponses.json} + } } \ No newline at end of file