diff --git a/batch/src/main/java/com/navercorp/pinpoint/batch/alarm/DataCollectorFactory.java b/batch/src/main/java/com/navercorp/pinpoint/batch/alarm/DataCollectorFactory.java index 28e4fee90ef6..d363c27ec864 100644 --- a/batch/src/main/java/com/navercorp/pinpoint/batch/alarm/DataCollectorFactory.java +++ b/batch/src/main/java/com/navercorp/pinpoint/batch/alarm/DataCollectorFactory.java @@ -25,6 +25,7 @@ import com.navercorp.pinpoint.batch.alarm.collector.ResponseTimeDataCollector; import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; +import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; import com.navercorp.pinpoint.web.alarm.CheckerCategory; import com.navercorp.pinpoint.web.alarm.DataCollectorCategory; @@ -33,9 +34,7 @@ import com.navercorp.pinpoint.web.dao.hbase.HbaseMapResponseTimeDao; import com.navercorp.pinpoint.web.dao.hbase.HbaseMapStatisticsCallerDao; import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import com.navercorp.pinpoint.web.dao.stat.FileDescriptorDao; import com.navercorp.pinpoint.web.vo.Application; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import java.util.Objects; @@ -58,7 +57,7 @@ public class DataCollectorFactory { private final AgentStatDao dataSourceDao; - private final FileDescriptorDao fileDescriptorDao; + private final AgentStatDao fileDescriptorDao; private final AgentEventDao agentEventDao; @@ -67,10 +66,10 @@ public class DataCollectorFactory { private final HbaseMapStatisticsCallerDao mapStatisticsCallerDao; public DataCollectorFactory(HbaseMapResponseTimeDao hbaseMapResponseTimeDao, - @Qualifier("jvmGcDaoFactory") AgentStatDao jvmGcDao, - @Qualifier("cpuLoadDaoFactory") AgentStatDao cpuLoadDao, - @Qualifier("dataSourceDaoFactory") AgentStatDao dataSourceDao, - @Qualifier("fileDescriptorDaoFactory") FileDescriptorDao fileDescriptorDao, + AgentStatDao jvmGcDao, + AgentStatDao cpuLoadDao, + AgentStatDao dataSourceDao, + AgentStatDao fileDescriptorDao, AgentEventDao agentEventDao, HbaseApplicationIndexDao hbaseApplicationIndexDao, HbaseMapStatisticsCallerDao mapStatisticsCallerDao) { diff --git a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/GcCountCheckerTest.java b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/GcCountCheckerTest.java index 9ad3f42e3c10..1a7b342bdbf6 100644 --- a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/GcCountCheckerTest.java +++ b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/GcCountCheckerTest.java @@ -16,8 +16,10 @@ package com.navercorp.pinpoint.batch.alarm.checker; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.common.server.bo.stat.join.StatType; import com.navercorp.pinpoint.web.dao.ApplicationIndexDao; import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; import com.navercorp.pinpoint.web.vo.Application; @@ -43,7 +45,12 @@ public class GcCountCheckerTest { @BeforeClass public static void before() { - jvmGcDao = new AgentStatDao() { + jvmGcDao = new AgentStatDao<>() { + + @Override + public String getChartType() { + return AgentStatType.JVM_GC.getChartType(); + } @Override public List getAgentStatList(String agentId, Range range) { @@ -64,7 +71,12 @@ public boolean agentStatExists(String agentId, Range range) { } }; - cpuLoadDao = new AgentStatDao() { + cpuLoadDao = new AgentStatDao<>() { + + @Override + public String getChartType() { + return AgentStatType.CPU_LOAD.getChartType(); + } @Override public List getAgentStatList(String agentId, Range range) { diff --git a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/HeapUsageRateCheckerTest.java b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/HeapUsageRateCheckerTest.java index 688553b43a27..dbafd0ab7589 100644 --- a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/HeapUsageRateCheckerTest.java +++ b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/HeapUsageRateCheckerTest.java @@ -16,6 +16,7 @@ package com.navercorp.pinpoint.batch.alarm.checker; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; import com.navercorp.pinpoint.web.alarm.CheckerCategory; import com.navercorp.pinpoint.web.alarm.DataCollectorCategory; import com.navercorp.pinpoint.batch.alarm.DataCollectorFactory; @@ -45,18 +46,24 @@ public class HeapUsageRateCheckerTest { private static final String SERVICE_TYPE = "tomcat"; private static ApplicationIndexDao applicationIndexDao; - + private static AgentStatDao jvmGcDao; private static AgentStatDao cpuLoadDao; - + @BeforeClass - public static void before() {jvmGcDao = new AgentStatDao() { + public static void before() { + jvmGcDao = new AgentStatDao<>() { + + @Override + public String getChartType() { + return AgentStatType.JVM_GC.getChartType(); + } @Override public List getAgentStatList(String agentId, Range range) { List jvmGcs = new LinkedList<>(); - + for (int i = 0; i < 36; i++) { JvmGcBo jvmGcBo = new JvmGcBo(); jvmGcBo.setHeapUsed(70L); @@ -64,7 +71,7 @@ public List getAgentStatList(String agentId, Range range) { jvmGcs.add(jvmGcBo); } - + return jvmGcs; } @@ -74,7 +81,12 @@ public boolean agentStatExists(String agentId, Range range) { } }; - cpuLoadDao = new AgentStatDao() { + cpuLoadDao = new AgentStatDao<>() { + + @Override + public String getChartType() { + return AgentStatType.CPU_LOAD.getChartType(); + } @Override public List getAgentStatList(String agentId, Range range) { @@ -106,7 +118,7 @@ public List selectAgentIds(String applicationName) { agentIds.add("local_tomcat"); return agentIds; } - + throw new IllegalArgumentException(); } @@ -124,40 +136,40 @@ public void deleteAgentIds(Map> applicationAgentIdMap) { public void deleteAgentId(String applicationName, String agentId) { throw new UnsupportedOperationException(); } - + }; } - + @Test public void checkTest1() { Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.HEAP_USAGE_RATE.getName(), 70, "testGroup", false, false, false, ""); Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE); AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN); AgentChecker checker = new HeapUsageRateChecker(collector, rule); - + checker.check(); assertTrue(checker.isDetected()); } - + @Test public void checkTest2() { Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.HEAP_USAGE_RATE.getName(), 71, "testGroup", false, false, false, ""); Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE); AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN); AgentChecker checker = new HeapUsageRateChecker(collector, rule); - + checker.check(); assertFalse(checker.isDetected()); } - + // @Autowired // private HbaseAgentStatDao hbaseAgentStatDao ; - + // @Autowired // private HbaseApplicationIndexDao applicationIndexDao; - + // @Test // public void checkTest1() { // Rule rule = new Rule(SERVICE_NAME, CheckerCategory.HEAP_USAGE_RATE.getName(), 60, "testGroup", false, false); diff --git a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/JvmCpuUsageRateCheckerTest.java b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/JvmCpuUsageRateCheckerTest.java index 552999cd9478..65a1dd359709 100644 --- a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/JvmCpuUsageRateCheckerTest.java +++ b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/checker/JvmCpuUsageRateCheckerTest.java @@ -16,6 +16,7 @@ package com.navercorp.pinpoint.batch.alarm.checker; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; import com.navercorp.pinpoint.web.alarm.CheckerCategory; import com.navercorp.pinpoint.web.alarm.DataCollectorCategory; import com.navercorp.pinpoint.batch.alarm.DataCollectorFactory; @@ -52,7 +53,12 @@ public class JvmCpuUsageRateCheckerTest { @BeforeClass public static void before() { - jvmGcDao = new AgentStatDao() { + jvmGcDao = new AgentStatDao<>() { + + @Override + public String getChartType() { + return AgentStatType.JVM_GC.getChartType(); + } @Override public List getAgentStatList(String agentId, Range range) { @@ -65,7 +71,11 @@ public boolean agentStatExists(String agentId, Range range) { } }; - cpuLoadDao = new AgentStatDao() { + cpuLoadDao = new AgentStatDao<>() { + @Override + public String getChartType() { + return AgentStatType.CPU_LOAD.getChartType(); + } public List getAgentStatList(String agentId, Range range) { List cpuLoads = new LinkedList<>(); diff --git a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/collector/FileDescriptorDataCollectorTest.java b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/collector/FileDescriptorDataCollectorTest.java index bc9b8ba76d37..b01df5979f66 100644 --- a/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/collector/FileDescriptorDataCollectorTest.java +++ b/batch/src/test/java/com/navercorp/pinpoint/batch/alarm/collector/FileDescriptorDataCollectorTest.java @@ -21,7 +21,7 @@ import com.navercorp.pinpoint.common.trace.ServiceType; import com.navercorp.pinpoint.batch.alarm.DataCollectorFactory; import com.navercorp.pinpoint.web.dao.ApplicationIndexDao; -import com.navercorp.pinpoint.web.dao.stat.FileDescriptorDao; +import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; import com.navercorp.pinpoint.web.vo.Application; import com.navercorp.pinpoint.common.server.util.time.Range; import org.junit.Test; @@ -51,7 +51,7 @@ public void collect() { ApplicationIndexDao applicationIndexDao = mock(ApplicationIndexDao.class); when(applicationIndexDao.selectAgentIds(applicationId)).thenReturn(agentList); - FileDescriptorDao fileDescriptorDao = mock(FileDescriptorDao.class); + AgentStatDao fileDescriptorDao = mock(AgentStatDao.class); long timeStamp = 1558936971494L; Range range = Range.newUncheckedRange(timeStamp - DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN, timeStamp); diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/AgentStatType.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/AgentStatType.java index 032419678fc9..5321f7a758de 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/AgentStatType.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/AgentStatType.java @@ -23,35 +23,37 @@ * @author HyunGil Jeong */ public enum AgentStatType { - UNKNOWN(0, "Unknown"), - JVM_GC(1, "JVM GC"), - JVM_GC_DETAILED(2, "JVM GC Detailed"), - CPU_LOAD(3, "Cpu Usage"), - TRANSACTION((byte) 4, "Transaction"), - ACTIVE_TRACE((byte) 5, "Active Trace"), - DATASOURCE((byte) 6, "DataSource"), - RESPONSE_TIME((byte) 7, "Response Time"), - DEADLOCK((byte) 8, "Deadlock"), - FILE_DESCRIPTOR((byte) 9, "FileDescriptor"), - DIRECT_BUFFER((byte) 10, "DirectBuffer"), - TOTAL_THREAD((byte) 11, "Total Thread Count"), - LOADED_CLASS((byte) 12, "Loaded Class"), + UNKNOWN(0, "Unknown", null), + JVM_GC(1, "JVM GC", "jvmGc"), + JVM_GC_DETAILED(2, "JVM GC Detailed", "jvmGcDetailed"), + CPU_LOAD(3, "Cpu Usage", "cpuLoad"), + TRANSACTION((byte) 4, "Transaction", "transaction"), + ACTIVE_TRACE((byte) 5, "Active Trace", "activeTrace"), + DATASOURCE((byte) 6, "DataSource", "dataSource"), + RESPONSE_TIME((byte) 7, "Response Time", "responseTime"), + DEADLOCK((byte) 8, "Deadlock", "deadlock"), + FILE_DESCRIPTOR((byte) 9, "FileDescriptor", "fileDescriptor"), + DIRECT_BUFFER((byte) 10, "DirectBuffer", "directBuffer"), + TOTAL_THREAD((byte) 11, "Total Thread Count", "totalThreadCount"), + LOADED_CLASS((byte) 12, "Loaded Class", "loadedClass"), - URI((byte) 100, "Agent URI Stat"); + URI((byte) 100, "Agent URI Stat", "uriStat"); public static final int TYPE_CODE_BYTE_LENGTH = 1; private final byte typeCode; private final String name; + private final String chartType; private static final Set AGENT_STAT_TYPES = EnumSet.allOf(AgentStatType.class); - AgentStatType(int typeCode, String name) { + AgentStatType(int typeCode, String name, String chartType) { if (typeCode < 0 || typeCode > 255) { throw new IllegalArgumentException("type code out of range (0~255)"); } this.typeCode = (byte) (typeCode & 0xFF); this.name = name; + this.chartType = chartType; } public int getTypeCode() { @@ -66,6 +68,10 @@ public String getName() { return name; } + public String getChartType() { + return chartType; + } + @Override public String toString() { return this.name; diff --git a/web/src/main/java/com/navercorp/pinpoint/web/AuthorizationConfig.java b/web/src/main/java/com/navercorp/pinpoint/web/AuthorizationConfig.java index 33bc0633d592..f91dda05a8f1 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/AuthorizationConfig.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/AuthorizationConfig.java @@ -16,23 +16,14 @@ package com.navercorp.pinpoint.web; +import com.fasterxml.jackson.core.type.ResolvedType; import com.navercorp.pinpoint.common.server.bo.SpanBo; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; +import com.navercorp.pinpoint.common.server.bo.stat.AgentWarningStatDataPoint; import com.navercorp.pinpoint.web.authorization.controller.AdminController; import com.navercorp.pinpoint.web.authorization.controller.AgentCommandController; import com.navercorp.pinpoint.web.authorization.controller.AgentInfoController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.ActiveTraceController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.CpuLoadController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.DataSourceController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.DeadlockController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.DirectBufferController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.FileDescriptorController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.JvmGcController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.JvmGcDetailedController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.LoadedClassCountController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.ResponseTimeController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.TotalThreadCountController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.TransactionController; -import com.navercorp.pinpoint.web.authorization.controller.AgentStatController.UriStatController; +import com.navercorp.pinpoint.web.authorization.controller.AgentStatController; import com.navercorp.pinpoint.web.authorization.controller.AlarmController; import com.navercorp.pinpoint.web.authorization.controller.ApplicationDataSourceController; import com.navercorp.pinpoint.web.authorization.controller.ApplicationStatController; @@ -56,36 +47,16 @@ import com.navercorp.pinpoint.web.service.WebhookSendInfoService; import com.navercorp.pinpoint.web.service.appmetric.ApplicationDataSourceService; import com.navercorp.pinpoint.web.service.appmetric.ApplicationStatChartService; -import com.navercorp.pinpoint.web.service.stat.ActiveTraceChartService; -import com.navercorp.pinpoint.web.service.stat.ActiveTraceService; -import com.navercorp.pinpoint.web.service.stat.AgentUriStatChartService; -import com.navercorp.pinpoint.web.service.stat.AgentUriStatService; -import com.navercorp.pinpoint.web.service.stat.CpuLoadChartService; -import com.navercorp.pinpoint.web.service.stat.CpuLoadService; -import com.navercorp.pinpoint.web.service.stat.DataSourceChartService; -import com.navercorp.pinpoint.web.service.stat.DataSourceService; -import com.navercorp.pinpoint.web.service.stat.DeadlockChartService; -import com.navercorp.pinpoint.web.service.stat.DeadlockService; -import com.navercorp.pinpoint.web.service.stat.DirectBufferChartService; -import com.navercorp.pinpoint.web.service.stat.DirectBufferService; -import com.navercorp.pinpoint.web.service.stat.FileDescriptorChartService; -import com.navercorp.pinpoint.web.service.stat.FileDescriptorService; -import com.navercorp.pinpoint.web.service.stat.JvmGcChartService; -import com.navercorp.pinpoint.web.service.stat.JvmGcDetailedChartService; -import com.navercorp.pinpoint.web.service.stat.JvmGcDetailedService; -import com.navercorp.pinpoint.web.service.stat.JvmGcService; -import com.navercorp.pinpoint.web.service.stat.LoadedClassCountChartService; -import com.navercorp.pinpoint.web.service.stat.LoadedClassCountService; -import com.navercorp.pinpoint.web.service.stat.ResponseTimeChartService; -import com.navercorp.pinpoint.web.service.stat.ResponseTimeService; -import com.navercorp.pinpoint.web.service.stat.TotalThreadCountChartService; -import com.navercorp.pinpoint.web.service.stat.TotalThreadCountService; -import com.navercorp.pinpoint.web.service.stat.TransactionChartService; -import com.navercorp.pinpoint.web.service.stat.TransactionService; +import com.navercorp.pinpoint.web.service.stat.AgentStatChartService; +import com.navercorp.pinpoint.web.service.stat.AgentStatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.core.ResolvableType; import java.util.List; +import java.util.Map; /** * @author minwoo.jung @@ -102,70 +73,12 @@ public UserController createUserController(UserService userService) { public AgentInfoController createAgentInfoController(AgentInfoService agentInfoService, AgentEventService agentEventService) { return new AgentInfoController(agentInfoService, agentEventService); } - - @Bean - public JvmGcController createJvmGcController(JvmGcService jvmGcService, JvmGcChartService jvmGcChartService) { - return new JvmGcController(jvmGcService, jvmGcChartService); - } - - @Bean - public JvmGcDetailedController createJvmGcDetailedController(JvmGcDetailedService jvmGcDetailedService, JvmGcDetailedChartService jvmGcDetailedChartService) { - return new JvmGcDetailedController(jvmGcDetailedService, jvmGcDetailedChartService); - } - - @Bean - public CpuLoadController createCpuLoadController(CpuLoadService cpuLoadService, CpuLoadChartService cpuLoadChartService) { - return new CpuLoadController(cpuLoadService, cpuLoadChartService); - } - - @Bean - public TransactionController createTransactionController(TransactionService transactionService, TransactionChartService transactionChartService) { - return new TransactionController(transactionService, transactionChartService); - } - - @Bean - public ActiveTraceController createActiveTraceController(ActiveTraceService activeTraceService, ActiveTraceChartService activeTraceChartService) { - return new ActiveTraceController(activeTraceService, activeTraceChartService); - } - - @Bean - public DataSourceController createDataSourceController(DataSourceService dataSourceService, DataSourceChartService dataSourceChartService) { - return new DataSourceController(dataSourceService, dataSourceChartService); - } - - @Bean - public ResponseTimeController createResponseTimeController(ResponseTimeService responseTimeService, ResponseTimeChartService responseTimeChartService) { - return new ResponseTimeController(responseTimeService, responseTimeChartService); - } - - @Bean - public DeadlockController createDeadlockController(DeadlockService deadlockService, DeadlockChartService deadlockChartService) { - return new DeadlockController(deadlockService, deadlockChartService); - } - - @Bean - public FileDescriptorController createFileDescriptorController(FileDescriptorService fileDescriptorService, FileDescriptorChartService fileDescriptorChartService) { - return new FileDescriptorController(fileDescriptorService, fileDescriptorChartService); - } - @Bean - public DirectBufferController createDirectBufferController(DirectBufferService directBufferService, DirectBufferChartService directBufferChartService) { - return new DirectBufferController(directBufferService, directBufferChartService); - } - - @Bean - public TotalThreadCountController createTotalThreadCountController(TotalThreadCountService totalThreadCountService, TotalThreadCountChartService totalThreadCountChartService) { - return new TotalThreadCountController(totalThreadCountService, totalThreadCountChartService); - } + public AgentStatController createAgentStatController(List agentStatServiceList, + List agentStatChartServiceList) { - @Bean - public LoadedClassCountController createLoadedClassCountController(LoadedClassCountService loadedClassCountService, LoadedClassCountChartService loadedClassCountChartService) { - return new LoadedClassCountController(loadedClassCountService, loadedClassCountChartService); - } - - @Bean - public UriStatController createUriStatController(AgentUriStatService agentUriStatService, AgentUriStatChartService agentUriStatChartService) { - return new UriStatController(agentUriStatService, agentUriStatChartService); + List> service = (List>) (List) agentStatServiceList; + return new AgentStatController<>(service, agentStatChartServiceList); } @Bean diff --git a/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentStatController.java b/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentStatController.java index 60e024db1f89..9d12d5a8adbb 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentStatController.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentStatController.java @@ -18,98 +18,96 @@ -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; -import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; -import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; -import com.navercorp.pinpoint.web.service.stat.ActiveTraceChartService; -import com.navercorp.pinpoint.web.service.stat.ActiveTraceService; import com.navercorp.pinpoint.web.service.stat.AgentStatChartService; import com.navercorp.pinpoint.web.service.stat.AgentStatService; -import com.navercorp.pinpoint.web.service.stat.AgentUriStatChartService; -import com.navercorp.pinpoint.web.service.stat.AgentUriStatService; -import com.navercorp.pinpoint.web.service.stat.CpuLoadChartService; -import com.navercorp.pinpoint.web.service.stat.CpuLoadService; -import com.navercorp.pinpoint.web.service.stat.DataSourceChartService; -import com.navercorp.pinpoint.web.service.stat.DataSourceService; -import com.navercorp.pinpoint.web.service.stat.DeadlockChartService; -import com.navercorp.pinpoint.web.service.stat.DeadlockService; -import com.navercorp.pinpoint.web.service.stat.DirectBufferChartService; -import com.navercorp.pinpoint.web.service.stat.DirectBufferService; -import com.navercorp.pinpoint.web.service.stat.FileDescriptorChartService; -import com.navercorp.pinpoint.web.service.stat.FileDescriptorService; -import com.navercorp.pinpoint.web.service.stat.JvmGcChartService; -import com.navercorp.pinpoint.web.service.stat.JvmGcDetailedChartService; -import com.navercorp.pinpoint.web.service.stat.JvmGcDetailedService; -import com.navercorp.pinpoint.web.service.stat.JvmGcService; -import com.navercorp.pinpoint.web.service.stat.ResponseTimeChartService; -import com.navercorp.pinpoint.web.service.stat.ResponseTimeService; -import com.navercorp.pinpoint.web.service.stat.TransactionChartService; -import com.navercorp.pinpoint.web.service.stat.TransactionService; -import com.navercorp.pinpoint.web.service.stat.TotalThreadCountChartService; -import com.navercorp.pinpoint.web.service.stat.TotalThreadCountService; -import com.navercorp.pinpoint.web.service.stat.LoadedClassCountChartService; -import com.navercorp.pinpoint.web.service.stat.LoadedClassCountService; import com.navercorp.pinpoint.web.util.TimeWindow; import com.navercorp.pinpoint.web.util.TimeWindowSampler; import com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler; import com.navercorp.pinpoint.common.server.util.time.Range; import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; +import java.util.Map; /** * @author emeroad * @author minwoo.jung * @author HyunGil Jeong */ -public abstract class AgentStatController { +@RestController +@RequestMapping("/getAgentStat/{chartType}") +public class AgentStatController { + private final Logger logger = LogManager.getLogger(this.getClass()); - private final AgentStatService agentStatService; + private final Map> agentStatServiceMap; - private final AgentStatChartService agentStatChartService; + private final Map agentStatChartServiceMap; - public AgentStatController(AgentStatService agentStatService, AgentStatChartService agentStatChartService) { - this.agentStatService = agentStatService; - this.agentStatChartService = agentStatChartService; + public AgentStatController(List> agentStatServiceList, List agentStatChartServiceLIst) { + this.agentStatServiceMap = buildDispatchMap(agentStatServiceList); + this.agentStatChartServiceMap = buildDispatchMap(agentStatChartServiceLIst); + } + + private Map buildDispatchMap(List list) { + ChartTypeMappingBuilder mapping = new ChartTypeMappingBuilder<>(); + + Map map = mapping.build(list); + + for (Map.Entry entry : map.entrySet()) { + Class serviceClass = entry.getValue().getClass(); + String chartType = entry.getKey(); + logger.info("chartType:{} {}", chartType, serviceClass.getSimpleName()); + } + return map; + } + + + private T getChartService(Map map, String chartType) { + T service = map.get(chartType); + if (service == null) { + throw new IllegalArgumentException("chartType pathVariable not found " + chartType); + } + return service; } @GetMapping() - public List getAgentStat( + public List getAgentStat( @RequestParam("agentId") String agentId, + @PathVariable("chartType") String chartType, @RequestParam("from") long from, @RequestParam("to") long to) { Range rangeToScan = Range.between(from, to); - return this.agentStatService.selectAgentStatList(agentId, rangeToScan); + + AgentStatService agentStatService = getChartService(this.agentStatServiceMap, chartType); + return agentStatService.selectAgentStatList(agentId, rangeToScan); } + @GetMapping(value = "/chart") public StatChart getAgentStatChart( @RequestParam("agentId") String agentId, + @PathVariable("chartType") String chartType, @RequestParam("from") long from, @RequestParam("to") long to) { TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); TimeWindow timeWindow = new TimeWindow(Range.between(from, to), sampler); - return this.agentStatChartService.selectAgentChart(agentId, timeWindow); + + AgentStatChartService agentStatChartService = getChartService(this.agentStatChartServiceMap, chartType); + return agentStatChartService.selectAgentChart(agentId, timeWindow); } @GetMapping(value = "/chart", params = {"interval"}) public StatChart getAgentStatChart( @RequestParam("agentId") String agentId, + @PathVariable("chartType") String chartType, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("interval") Integer interval) { @@ -122,22 +120,28 @@ public long getWindowSize(Range range) { } }; TimeWindow timeWindow = new TimeWindow(Range.between(from, to), sampler); - return this.agentStatChartService.selectAgentChart(agentId, timeWindow); + + AgentStatChartService agentStatChartService = getChartService(this.agentStatChartServiceMap, chartType); + return agentStatChartService.selectAgentChart(agentId, timeWindow); } @GetMapping(value = "/chartList") public List getAgentStatChartList( @RequestParam("agentId") String agentId, + @PathVariable("chartType") String chartType, @RequestParam("from") long from, @RequestParam("to") long to) { TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); TimeWindow timeWindow = new TimeWindow(Range.between(from, to), sampler); - return this.agentStatChartService.selectAgentChartList(agentId, timeWindow); + + AgentStatChartService agentStatChartService = getChartService(this.agentStatChartServiceMap, chartType); + return agentStatChartService.selectAgentChartList(agentId, timeWindow); } @GetMapping(value = "/chartList", params = {"interval"}) public List getAgentStatChartList( @RequestParam("agentId") String agentId, + @PathVariable("chartType") String chartType, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam("interval") Integer interval) { @@ -150,114 +154,9 @@ public long getWindowSize(Range range) { } }; TimeWindow timeWindow = new TimeWindow(Range.between(from, to), sampler); - return this.agentStatChartService.selectAgentChartList(agentId, timeWindow); - } - - @RestController - @RequestMapping("/getAgentStat/jvmGc") - public static class JvmGcController extends AgentStatController { - public JvmGcController(JvmGcService jvmGcService, JvmGcChartService jvmGcChartService) { - super(jvmGcService, jvmGcChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/jvmGcDetailed") - public static class JvmGcDetailedController extends AgentStatController { - public JvmGcDetailedController(JvmGcDetailedService jvmGcDetailedService, JvmGcDetailedChartService jvmGcDetailedChartService) { - super(jvmGcDetailedService, jvmGcDetailedChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/cpuLoad") - public static class CpuLoadController extends AgentStatController { - public CpuLoadController(CpuLoadService cpuLoadService, CpuLoadChartService cpuLoadChartService) { - super(cpuLoadService, cpuLoadChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/transaction") - public static class TransactionController extends AgentStatController { - public TransactionController(TransactionService transactionService, TransactionChartService transactionChartService) { - super(transactionService, transactionChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/activeTrace") - public static class ActiveTraceController extends AgentStatController { - public ActiveTraceController(ActiveTraceService activeTraceService, ActiveTraceChartService activeTraceChartService) { - super(activeTraceService, activeTraceChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/dataSource") - public static class DataSourceController extends AgentStatController { - public DataSourceController(DataSourceService dataSourceService, DataSourceChartService dataSourceChartService) { - super(dataSourceService, dataSourceChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/responseTime") - public static class ResponseTimeController extends AgentStatController { - public ResponseTimeController(ResponseTimeService responseTimeService, ResponseTimeChartService responseTimeChartService) { - super(responseTimeService, responseTimeChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/deadlock") - public static class DeadlockController extends AgentStatController { - public DeadlockController(DeadlockService deadlockService, DeadlockChartService deadlockChartService) { - super(deadlockService, deadlockChartService); - } - } - @RestController - @RequestMapping("/getAgentStat/fileDescriptor") - public static class FileDescriptorController extends AgentStatController { - public FileDescriptorController(FileDescriptorService fileDescriptorService, FileDescriptorChartService fileDescriptorChartService) { - super(fileDescriptorService, fileDescriptorChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/directBuffer") - public static class DirectBufferController extends AgentStatController { - public DirectBufferController(DirectBufferService directBufferService, DirectBufferChartService directBufferChartService) { - super(directBufferService, directBufferChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/totalThreadCount") - public static class TotalThreadCountController extends AgentStatController { - public TotalThreadCountController(TotalThreadCountService totalThreadCountService, - TotalThreadCountChartService totalThreadCountChartService) { - super(totalThreadCountService, totalThreadCountChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/loadedClass") - public static class LoadedClassCountController extends AgentStatController { - public LoadedClassCountController(LoadedClassCountService loadedClassCountService, - LoadedClassCountChartService loadedClassCountChartService) { - super(loadedClassCountService, loadedClassCountChartService); - } - } - - @RestController - @RequestMapping("/getAgentStat/uriStat") - public static class UriStatController extends AgentStatController { - public UriStatController(AgentUriStatService agentUriStatService, - AgentUriStatChartService agentUriStatChartService) { - super(agentUriStatService, agentUriStatChartService); - } + AgentStatChartService agentStatChartService = getChartService(this.agentStatChartServiceMap, chartType); + return agentStatChartService.selectAgentChartList(agentId, timeWindow); } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ChartTypeMappingBuilder.java b/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ChartTypeMappingBuilder.java new file mode 100644 index 000000000000..78ac45bd8e12 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ChartTypeMappingBuilder.java @@ -0,0 +1,38 @@ +package com.navercorp.pinpoint.web.authorization.controller; + +import com.navercorp.pinpoint.web.service.stat.ChartTypeSupport; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ChartTypeMappingBuilder { + + + public ChartTypeMappingBuilder() { + } + + public Map build(List serviceList) { + Map map = new HashMap<>(); + for (T service : serviceList) { + final String chartType = getChartType(service); + + T duplicate = map.put(chartType, service); + if (duplicate != null) { + String errorMessage = String.format("Duplicated ChartService chartType:%s %s:%s", chartType, service, duplicate); + throw new IllegalArgumentException(errorMessage); + } + } + + return Map.copyOf(map); + } + + protected String getChartType(T service) { + if (service instanceof ChartTypeSupport) { + ChartTypeSupport a = (ChartTypeSupport)service; + return a.getChartType(); + } + throw new RuntimeException("Unknown ChartTypeSupport " + service); + } + +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/SampledAgentStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/SampledAgentStatDao.java index fe9e0e8a91d1..10a96c3626a7 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/SampledAgentStatDao.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/SampledAgentStatDao.java @@ -16,15 +16,18 @@ package com.navercorp.pinpoint.web.dao; +import com.navercorp.pinpoint.web.service.stat.ChartTypeSupport; import com.navercorp.pinpoint.web.util.TimeWindow; import com.navercorp.pinpoint.web.vo.stat.SampledAgentStatDataPoint; +import org.springframework.stereotype.Repository; import java.util.List; /** * @author HyunGil Jeong */ -public interface SampledAgentStatDao { +@Repository +public interface SampledAgentStatDao extends ChartTypeSupport { List getSampledAgentStatList(String agentId, TimeWindow timeWindow); } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/config/AgentStatDaoConfiguration.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/config/AgentStatDaoConfiguration.java new file mode 100644 index 000000000000..b8adb198008b --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/config/AgentStatDaoConfiguration.java @@ -0,0 +1,106 @@ +package com.navercorp.pinpoint.web.dao.hbase.config; + +import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; +import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; +import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; +import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; +import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; +import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; +import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; +import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; +import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; +import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; +import com.navercorp.pinpoint.web.dao.hbase.stat.DefaultAgentStatDao; +import com.navercorp.pinpoint.web.dao.hbase.stat.HbaseAgentStatDaoOperations; +import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Objects; + +@Configuration +public class AgentStatDaoConfiguration { + private final HbaseAgentStatDaoOperations operations; + + public AgentStatDaoConfiguration(HbaseAgentStatDaoOperations operations) { + this.operations = Objects.requireNonNull(operations, "operations"); + } + + private AgentStatDao newStatDao(AgentStatType statType, AgentStatDecoder decoder) { + Objects.requireNonNull(statType, "statType"); + Objects.requireNonNull(decoder, "decoder"); + + return new DefaultAgentStatDao<>(statType, operations, decoder); + } + + @Bean + public AgentStatDao getJvmGcDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.JVM_GC, decoder); + } + + @Bean + public AgentStatDao getJvmGcDetailedDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.JVM_GC_DETAILED, decoder); + } + + @Bean + public AgentStatDao getCpuLoadDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.CPU_LOAD, decoder); + } + + @Bean + public AgentStatDao getTransactionDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.TRANSACTION, decoder); + } + + @Bean + public AgentStatDao getActiveTraceDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.ACTIVE_TRACE, decoder); + } + + @Bean + public AgentStatDao getDataSourceListDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.DATASOURCE, decoder); + } + + @Bean + public AgentStatDao getResponseTimeDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.RESPONSE_TIME, decoder); + } + + @Bean + public AgentStatDao getDeadlockThreadCountDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.DEADLOCK, decoder); + } + + @Bean + public AgentStatDao getFileDescriptorDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.FILE_DESCRIPTOR, decoder); + } + + @Bean + public AgentStatDao getDirectBufferDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.DIRECT_BUFFER, decoder); + } + + @Bean + public AgentStatDao getTotalThreadCountDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.TOTAL_THREAD, decoder); + } + + @Bean + public AgentStatDao getLoadedClassDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.LOADED_CLASS, decoder); + } + + @Bean + public AgentStatDao getAgentUriStatDao(AgentStatDecoder decoder) { + return newStatDao(AgentStatType.URI, decoder); + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/AgentStatDaoConfiguration.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/AgentStatDaoConfiguration.java deleted file mode 100644 index b9b19bd25157..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/AgentStatDaoConfiguration.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.navercorp.pinpoint.web.dao.hbase.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; -import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; -import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class AgentStatDaoConfiguration { - - @Bean("jvmGcDaoFactory") - public AgentStatDao getJvmGcDao(@Qualifier("jvmGcDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("jvmGcDetailedDaoFactory") - public AgentStatDao getJvmGcDetailedDao(@Qualifier("jvmGcDetailedDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("cpuLoadDaoFactory") - public AgentStatDao getCpuLoadDao(@Qualifier("cpuLoadDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("transactionDaoFactory") - public AgentStatDao getTransactionDao(@Qualifier("transactionDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("activeTraceDaoFactory") - public AgentStatDao getActiveTraceDao(@Qualifier("activeTraceDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("dataSourceDaoFactory") - public AgentStatDao getDataSourceListDao(@Qualifier("dataSourceDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("responseTimeDaoFactory") - public AgentStatDao getResponseTimeDao(@Qualifier("responseTimeDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("deadlockDaoFactory") - public AgentStatDao getDeadlockThreadCountDao(@Qualifier("deadlockDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("fileDescriptorDaoFactory") - public AgentStatDao getFileDescriptorDao(@Qualifier("fileDescriptorDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("directBufferDaoFactory") - public AgentStatDao getDirectBufferDao(@Qualifier("directBufferDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("totalThreadCountDaoFactory") - public AgentStatDao getTotalThreadCountDao(@Qualifier("totalThreadCountDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("loadedClassCountDaoFactory") - public AgentStatDao getLoadedClassDao(@Qualifier("loadedClassDaoV2") AgentStatDao v2) { - return v2; - } - - @Bean("agentUriStatDao") - public AgentStatDao getAgentUriStatDao(@Qualifier("agentUriStatDaoV2") AgentStatDao v2) { - return v2; - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultAgentStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultAgentStatDao.java similarity index 80% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultAgentStatDao.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultAgentStatDao.java index 16b75aa99666..dfa8b3c33327 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultAgentStatDao.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultAgentStatDao.java @@ -1,4 +1,4 @@ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; @@ -10,12 +10,12 @@ import java.util.List; import java.util.Objects; -public abstract class DefaultAgentStatDao implements AgentStatDao { +public class DefaultAgentStatDao implements AgentStatDao { private final AgentStatType statType; - private final HbaseAgentStatDaoOperationsV2 operations; + private final HbaseAgentStatDaoOperations operations; private final AgentStatDecoder decoder; - public DefaultAgentStatDao(AgentStatType statType, HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { + public DefaultAgentStatDao(AgentStatType statType, HbaseAgentStatDaoOperations operations, AgentStatDecoder decoder) { this.statType = Objects.requireNonNull(statType, "statType"); this.operations = Objects.requireNonNull(operations, "operations"); this.decoder = Objects.requireNonNull(decoder, "decoder"); @@ -38,4 +38,9 @@ public boolean agentStatExists(String agentId, Range range) { AgentStatMapperV2 mapper = operations.createRowMapper(decoder, range); return operations.agentStatExists(statType, mapper, agentId, range); } + + @Override + public String getChartType() { + return statType.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultSampledAgentStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultSampledAgentStatDao.java similarity index 90% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultSampledAgentStatDao.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultSampledAgentStatDao.java index 85adbbf11110..a8e06055015b 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/DefaultSampledAgentStatDao.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/DefaultSampledAgentStatDao.java @@ -1,4 +1,4 @@ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.ResultsExtractor; import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; @@ -15,12 +15,12 @@ public class DefaultSampledAgentStatDao implements SampledAgentStatDao { private final AgentStatType statType; - private final HbaseAgentStatDaoOperationsV2 operations; + private final HbaseAgentStatDaoOperations operations; private final AgentStatDecoder decoder; private final SampledResultsExtractorSupplier resultExtractor; public DefaultSampledAgentStatDao(AgentStatType statType, - HbaseAgentStatDaoOperationsV2 operations, + HbaseAgentStatDaoOperations operations, AgentStatDecoder decoder, SampledResultsExtractorSupplier resultExtractor) { this.statType = Objects.requireNonNull(statType, "statType"); @@ -42,5 +42,8 @@ public List getSampledAgentStatList(String agentId, TimeWindow timeWindow) return operations.getSampledAgentStatList(statType, resultExtractor, agentId, range); } - + @Override + public String getChartType() { + return statType.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentStatDaoOperationsV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java similarity index 94% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentStatDaoOperationsV2.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java index addd3e04d0b5..662557641b90 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentStatDaoOperationsV2.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.HbaseColumnFamily; import com.navercorp.pinpoint.common.hbase.HbaseOperations2; @@ -44,7 +44,7 @@ * @author HyunGil Jeong */ @Component -public class HbaseAgentStatDaoOperationsV2 { +public class HbaseAgentStatDaoOperations { private static final int AGENT_STAT_VER2_NUM_PARTITIONS = 32; private static final int MAX_SCAN_CACHE_SIZE = 256; @@ -58,9 +58,9 @@ public class HbaseAgentStatDaoOperationsV2 { private final AgentStatHbaseOperationFactory operationFactory; - public HbaseAgentStatDaoOperationsV2(HbaseOperations2 hbaseOperations2, - TableNameProvider tableNameProvider, - AgentStatHbaseOperationFactory operationFactory) { + public HbaseAgentStatDaoOperations(HbaseOperations2 hbaseOperations2, + TableNameProvider tableNameProvider, + AgentStatHbaseOperationFactory operationFactory) { this.hbaseOperations2 = Objects.requireNonNull(hbaseOperations2, "hbaseOperations2"); this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider"); this.operationFactory = Objects.requireNonNull(operationFactory, "operationFactory"); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoOperationsV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentUriStatDaoOperations.java similarity index 94% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoOperationsV2.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentUriStatDaoOperations.java index 9922b896a5a0..55aeaddade8c 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoOperationsV2.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentUriStatDaoOperations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.HbaseColumnFamily; import com.navercorp.pinpoint.common.hbase.HbaseOperations2; @@ -44,7 +44,7 @@ * @author HyunGil Jeong */ @Component -public class HbaseAgentUriStatDaoOperationsV2 { +public class HbaseAgentUriStatDaoOperations { private static final int AGENT_STAT_VER2_NUM_PARTITIONS = 32; private static final int MAX_SCAN_CACHE_SIZE = 256; @@ -58,9 +58,9 @@ public class HbaseAgentUriStatDaoOperationsV2 { private final AgentStatHbaseOperationFactory operationFactory; - public HbaseAgentUriStatDaoOperationsV2(HbaseOperations2 hbaseOperations2, - TableNameProvider tableNameProvider, - AgentStatHbaseOperationFactory operationFactory) { + public HbaseAgentUriStatDaoOperations(HbaseOperations2 hbaseOperations2, + TableNameProvider tableNameProvider, + AgentStatHbaseOperationFactory operationFactory) { this.hbaseOperations2 = Objects.requireNonNull(hbaseOperations2, "hbaseOperations2"); this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider"); this.operationFactory = Objects.requireNonNull(operationFactory, "operationFactory"); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledAgentUriStatDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledAgentUriStatDao.java similarity index 71% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledAgentUriStatDaoV2.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledAgentUriStatDao.java index c98c1f080837..f2523e44baf3 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledAgentUriStatDaoV2.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledAgentUriStatDao.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.ResultsExtractor; import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; @@ -22,7 +22,7 @@ import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; import com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo; import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.SampledAgentUriStatDao; +import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; import com.navercorp.pinpoint.web.mapper.stat.AgentStatMapperV2; import com.navercorp.pinpoint.web.mapper.stat.SampledUriStatResultExtractor; import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; @@ -37,34 +37,38 @@ /** * @author Taejin Koo */ -@Repository("sampledAgentUriStatDaoV2") -public class HbaseSampledAgentUriStatDaoV2 implements SampledAgentUriStatDao { +@Repository +public class HbaseSampledAgentUriStatDao implements SampledAgentStatDao { private final AgentStatType statType = AgentStatType.URI; - private final HbaseAgentUriStatDaoOperationsV2 operations; + private final HbaseAgentUriStatDaoOperations operations; - private final AgentStatDecoder agentUriStatDecoder; - private final AgentStatSampler agentUriStatSampler; + private final AgentStatDecoder decoder; + private final AgentStatSampler sampler; - public HbaseSampledAgentUriStatDaoV2(HbaseAgentUriStatDaoOperationsV2 operations, - AgentStatDecoder agentUriStatDecoder, - AgentStatSampler agentUriStatSampler) { + public HbaseSampledAgentUriStatDao(HbaseAgentUriStatDaoOperations operations, + AgentStatDecoder decoder, + AgentStatSampler sampler) { this.operations = Objects.requireNonNull(operations, "operations"); - this.agentUriStatDecoder = Objects.requireNonNull(agentUriStatDecoder, "agentUriStatDecoder"); - this.agentUriStatSampler = Objects.requireNonNull(agentUriStatSampler, "agentUriStatSampler"); + this.decoder = Objects.requireNonNull(decoder, "decoder"); + this.sampler = Objects.requireNonNull(sampler, "sampler"); } @Override public List getSampledAgentStatList(String agentId, TimeWindow timeWindow) { Range range = timeWindow.getWindowSlotRange(); - AgentStatMapperV2 mapper = operations.createRowMapper(agentUriStatDecoder, range); + AgentStatMapperV2 mapper = operations.createRowMapper(decoder, range); ResultsExtractor> resultExtractor = getResultExtractor(timeWindow, mapper); return operations.getSampledAgentStatList(statType, resultExtractor, agentId, range); } private ResultsExtractor> getResultExtractor(TimeWindow timeWindow, AgentStatMapperV2 mapper) { - return new SampledUriStatResultExtractor(timeWindow, mapper, agentUriStatSampler); + return new SampledUriStatResultExtractor(timeWindow, mapper, sampler); } + @Override + public String getChartType() { + return statType.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDataSourceDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledDataSourceDao.java similarity index 79% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDataSourceDaoV2.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledDataSourceDao.java index fdfa5080ea77..74632a2ddc2b 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDataSourceDaoV2.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseSampledDataSourceDao.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.ResultsExtractor; import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; @@ -22,7 +22,7 @@ import com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo; import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.SampledDataSourceDao; +import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; import com.navercorp.pinpoint.web.mapper.stat.AgentStatMapperV2; import com.navercorp.pinpoint.web.mapper.stat.SampledDataSourceResultExtractor; import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; @@ -37,18 +37,18 @@ /** * @author Taejin Koo */ -@Repository("sampledDataSourceDaoV2") -public class HbaseSampledDataSourceDaoV2 implements SampledDataSourceDao { +@Repository +public class HbaseSampledDataSourceDao implements SampledAgentStatDao { private final AgentStatType statType = AgentStatType.DATASOURCE; - private final HbaseAgentStatDaoOperationsV2 operations; + private final HbaseAgentStatDaoOperations operations; private final AgentStatDecoder decoder; private final AgentStatSampler sampler; - public HbaseSampledDataSourceDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { + public HbaseSampledDataSourceDao(HbaseAgentStatDaoOperations operations, + AgentStatDecoder decoder, + AgentStatSampler sampler) { this.operations = Objects.requireNonNull(operations, "operations"); this.decoder = Objects.requireNonNull(decoder, "decoder"); this.sampler = Objects.requireNonNull(sampler, "sampler"); @@ -63,4 +63,8 @@ public List getSampledAgentStatList(String agentId, TimeW return operations.getSampledAgentStatList(statType, resultExtractor, agentId, range); } + @Override + public String getChartType() { + return statType.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatDaoConfiguration.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatDaoConfiguration.java index dabbb0263a3d..3b98a44b3386 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatDaoConfiguration.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatDaoConfiguration.java @@ -1,12 +1,34 @@ package com.navercorp.pinpoint.web.dao.hbase.stat; +import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; +import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; +import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; +import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; +import com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo; +import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; +import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; +import com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo; +import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; +import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; +import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; +import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; +import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; import com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace; +import com.navercorp.pinpoint.web.vo.stat.SampledAgentStatDataPoint; import com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat; import com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad; +import com.navercorp.pinpoint.web.vo.stat.SampledDataSource; import com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList; import com.navercorp.pinpoint.web.vo.stat.SampledDeadlock; import com.navercorp.pinpoint.web.vo.stat.SampledDirectBuffer; +import com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo; import com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor; import com.navercorp.pinpoint.web.vo.stat.SampledJvmGc; import com.navercorp.pinpoint.web.vo.stat.SampledJvmGcDetailed; @@ -14,80 +36,112 @@ import com.navercorp.pinpoint.web.vo.stat.SampledResponseTime; import com.navercorp.pinpoint.web.vo.stat.SampledTotalThreadCount; import com.navercorp.pinpoint.web.vo.stat.SampledTransaction; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Repository; + +import java.util.Objects; @Configuration public class SampledAgentStatDaoConfiguration { - @Bean("sampledJvmGcDaoFactory") - public SampledAgentStatDao getSampledJvmGcDao(@Qualifier("sampledJvmGcDaoV2") SampledAgentStatDao v2) { - return v2; + private final HbaseAgentStatDaoOperations operations; + + public SampledAgentStatDaoConfiguration(HbaseAgentStatDaoOperations operations) { + this.operations = Objects.requireNonNull(operations, "operations"); } - @Bean("sampledJvmGcDetailedDaoFactory") - public SampledAgentStatDao getSampledJvmGcDetailedDao(@Qualifier("sampledJvmGcDetailedDaoV2") SampledAgentStatDao v2) { - return v2; + + private SampledAgentStatDao newSampledDao(AgentStatType statType, + AgentStatDecoder decoder, + AgentStatSampler sampler) { + Objects.requireNonNull(statType, "statType"); + Objects.requireNonNull(decoder, "decoder"); + Objects.requireNonNull(sampler, "sampler"); + + SampledResultsExtractorSupplier supplier = new SampledAgentStatResultExtractorSupplier<>(sampler); + return new DefaultSampledAgentStatDao<>(statType, operations, decoder, supplier); } - @Bean("sampledCpuLoadDaoFactory") - public SampledAgentStatDao getSampledCpuLoadDao(@Qualifier("sampledCpuLoadDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledJvmGcDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.JVM_GC, decoder, sampler); } - @Bean("sampledTransactionDaoFactory") - public SampledAgentStatDao getSampledTransactionDao(@Qualifier("sampledTransactionDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledJvmGcDetailedDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.JVM_GC_DETAILED, decoder, sampler); } + @Bean + public SampledAgentStatDao getSampledCpuLoadDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.CPU_LOAD, decoder, sampler); + } - @Bean("sampledActiveTraceDaoFactory") - public SampledAgentStatDao getSampledActiveTraceDao(@Qualifier("sampledActiveTraceDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledTransactionDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.TRANSACTION, decoder, sampler); } - @Bean("sampledDataSourceDaoFactory") - public SampledAgentStatDao getSampledDataSourceListDao(@Qualifier("sampledDataSourceDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledActiveTraceDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.ACTIVE_TRACE, decoder, sampler); + } + +// @Bean + public SampledAgentStatDao getSampledDataSourceListDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return new HbaseSampledDataSourceDao(operations, decoder, sampler); } - @Bean("sampledResponseTimeDaoFactory") - public SampledAgentStatDao getSampledResponseTimeDao(@Qualifier("sampledResponseTimeDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledResponseTimeDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.RESPONSE_TIME, decoder, sampler); } - @Bean("sampledDeadlockDaoFactory") - public SampledAgentStatDao getSampledDeadlockDao(@Qualifier("sampledDeadlockDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledDeadlockDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.DEADLOCK, decoder, sampler); } - @Bean("sampledFileDescriptorDaoFactory") - public SampledAgentStatDao getSampledFileDescriptorDao(@Qualifier("sampledFileDescriptorDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledFileDescriptorDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.FILE_DESCRIPTOR, decoder, sampler); } - @Bean("sampledDirectBufferDaoFactory") - public SampledAgentStatDao getSampledDirectBufferDao(@Qualifier("sampledDirectBufferDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledDirectBufferDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.DIRECT_BUFFER, decoder, sampler); } - @Bean("sampledTotalThreadCountDaoFactory") - public SampledAgentStatDao getSampledTotalThreadCountDao(@Qualifier("sampledTotalThreadCountDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledTotalThreadCountDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.TOTAL_THREAD, decoder, sampler); } - @Bean("sampledLoadedClassCountDaoFactory") - public SampledAgentStatDao getSampledLoadedClassCountDao(@Qualifier("sampledLoadedClassDaoV2") SampledAgentStatDao v2) { - return v2; + @Bean + public SampledAgentStatDao getSampledLoadedClassCountDao(AgentStatDecoder decoder, + AgentStatSampler sampler) { + return newSampledDao(AgentStatType.LOADED_CLASS, decoder, sampler); } - @Bean("sampledAgentUriStatDaoFactory") - public SampledAgentStatDao getSampledAgentUriStatDao(@Qualifier("sampledAgentUriStatDaoV2") SampledAgentStatDao v2) { - return v2; +// @Bean + public SampledAgentStatDao getSampledAgentUriStatDao(HbaseAgentUriStatDaoOperations operations, + AgentStatDecoder decoder, + AgentStatSampler sampler) { + return new HbaseSampledAgentUriStatDao(operations, decoder, sampler); } } \ No newline at end of file diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledAgentStatResultExtractorSupplier.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatResultExtractorSupplier.java similarity index 95% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledAgentStatResultExtractorSupplier.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatResultExtractorSupplier.java index c28a6fa284cb..31218a9ed7c1 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledAgentStatResultExtractorSupplier.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledAgentStatResultExtractorSupplier.java @@ -1,4 +1,4 @@ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.ResultsExtractor; import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledResultsExtractorSupplier.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledResultsExtractorSupplier.java similarity index 95% rename from web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledResultsExtractorSupplier.java rename to web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledResultsExtractorSupplier.java index c3f1ed607bec..090f0521eaef 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/SampledResultsExtractorSupplier.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/SampledResultsExtractorSupplier.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; +package com.navercorp.pinpoint.web.dao.hbase.stat; import com.navercorp.pinpoint.common.hbase.ResultsExtractor; import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HBaseSampledTotalThreadCountDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HBaseSampledTotalThreadCountDaoV2.java deleted file mode 100644 index 5fb460ca1082..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HBaseSampledTotalThreadCountDaoV2.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; -import com.navercorp.pinpoint.web.dao.stat.SampledTotalThreadCountDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledTotalThreadCount; -import org.springframework.stereotype.Repository; - - -@Repository("sampledTotalThreadCountDaoV2") -public class HBaseSampledTotalThreadCountDaoV2 - extends DefaultSampledAgentStatDao implements SampledTotalThreadCountDao { - - public HBaseSampledTotalThreadCountDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.TOTAL_THREAD, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseActiveTraceDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseActiveTraceDaoV2.java deleted file mode 100644 index afe4e41607d4..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseActiveTraceDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.web.dao.stat.ActiveTraceDao; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("activeTraceDaoV2") -public class HbaseActiveTraceDaoV2 extends DefaultAgentStatDao implements ActiveTraceDao { - - public HbaseActiveTraceDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.ACTIVE_TRACE, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoV2.java deleted file mode 100644 index 8e333cbb4559..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseAgentUriStatDaoV2.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentUriStatDao; -import com.navercorp.pinpoint.web.mapper.stat.AgentStatMapperV2; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Repository("agentUriStatDaoV2") -public class HbaseAgentUriStatDaoV2 implements AgentUriStatDao { - - private final AgentStatType statType = AgentStatType.URI; - private final HbaseAgentUriStatDaoOperationsV2 operations; - private final AgentStatDecoder decoder; - - - public HbaseAgentUriStatDaoV2(HbaseAgentUriStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - this.operations = Objects.requireNonNull(operations, "operations"); - this.decoder = Objects.requireNonNull(decoder, "decoder"); - } - - @Override - public List getAgentStatList(String agentId, Range range) { - AgentStatMapperV2 mapper = operations.createRowMapper(decoder, range); - return operations.getAgentStatList(statType, mapper, agentId, range); - } - - @Override - public boolean agentStatExists(String agentId, Range range) { - AgentStatMapperV2 mapper = operations.createRowMapper(decoder, range); - return operations.agentStatExists(statType, mapper, agentId, range); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseCpuLoadDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseCpuLoadDaoV2.java deleted file mode 100644 index 12e29a35b6af..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseCpuLoadDaoV2.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; -import com.navercorp.pinpoint.web.dao.stat.CpuLoadDao; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("cpuLoadDaoV2") -public class HbaseCpuLoadDaoV2 extends DefaultAgentStatDao implements CpuLoadDao { - public HbaseCpuLoadDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.CPU_LOAD, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDataSourceDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDataSourceDaoV2.java deleted file mode 100644 index 03282c2e0bb2..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDataSourceDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; -import com.navercorp.pinpoint.web.dao.stat.DataSourceDao; -import org.springframework.stereotype.Repository; - -/** - * @author Taejin Koo - */ -@Repository("dataSourceDaoV2") -public class HbaseDataSourceDaoV2 extends DefaultAgentStatDao implements DataSourceDao { - - public HbaseDataSourceDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.DATASOURCE, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDeadlockDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDeadlockDaoV2.java deleted file mode 100644 index f0f26fafd7f3..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDeadlockDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.web.dao.stat.DeadlockDao; -import org.springframework.stereotype.Repository; - -/** - * @author Taejin Koo - */ -@Repository("deadlockDaoV2") -public class HbaseDeadlockDaoV2 extends DefaultAgentStatDao implements DeadlockDao { - - public HbaseDeadlockDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.DEADLOCK, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDirectBufferDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDirectBufferDaoV2.java deleted file mode 100644 index 711a710bfaeb..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseDirectBufferDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2018 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; -import com.navercorp.pinpoint.web.dao.stat.DirectBufferDao; -import org.springframework.stereotype.Repository; - -/** - * @author Roy Kim - */ -@Repository("directBufferDaoV2") -public class HbaseDirectBufferDaoV2 extends DefaultAgentStatDao implements DirectBufferDao { - - public HbaseDirectBufferDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.DIRECT_BUFFER, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseFileDescriptorDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseFileDescriptorDaoV2.java deleted file mode 100644 index 0be148290616..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseFileDescriptorDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2018 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; -import com.navercorp.pinpoint.web.dao.stat.FileDescriptorDao; -import org.springframework.stereotype.Repository; - -/** - * @author Roy Kim - */ -@Repository("fileDescriptorDaoV2") -public class HbaseFileDescriptorDaoV2 extends DefaultAgentStatDao implements FileDescriptorDao { - - public HbaseFileDescriptorDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.FILE_DESCRIPTOR, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDaoV2.java deleted file mode 100644 index 59ee08238932..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; -import com.navercorp.pinpoint.web.dao.stat.JvmGcDao; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("jvmGcDaoV2") -public class HbaseJvmGcDaoV2 extends DefaultAgentStatDao implements JvmGcDao { - - public HbaseJvmGcDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.JVM_GC, operations, decoder); - } - -} \ No newline at end of file diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDetailedDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDetailedDaoV2.java deleted file mode 100644 index e6ace9869be8..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseJvmGcDetailedDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; -import com.navercorp.pinpoint.web.dao.stat.JvmGcDetailedDao; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("jvmGcDetailedDaoV2") -public class HbaseJvmGcDetailedDaoV2 extends DefaultAgentStatDao implements JvmGcDetailedDao { - - public HbaseJvmGcDetailedDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.JVM_GC_DETAILED, operations, decoder); - } - -} \ No newline at end of file diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseLoadedClassDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseLoadedClassDaoV2.java deleted file mode 100644 index a76a6ae962f8..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseLoadedClassDaoV2.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; -import com.navercorp.pinpoint.web.dao.stat.LoadedClassCountDao; -import org.springframework.stereotype.Repository; - -@Repository("loadedClassDaoV2") -public class HbaseLoadedClassDaoV2 extends DefaultAgentStatDao implements LoadedClassCountDao { - - public HbaseLoadedClassDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.LOADED_CLASS, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseResponseTimeDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseResponseTimeDaoV2.java deleted file mode 100644 index 5deec5d8f74c..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseResponseTimeDaoV2.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; -import com.navercorp.pinpoint.web.dao.stat.ResponseTimeDao; -import org.springframework.stereotype.Repository; - -/** - * @author Taejin Koo - */ -@Repository("responseTimeDaoV2") -public class HbaseResponseTimeDaoV2 extends DefaultAgentStatDao implements ResponseTimeDao { - - public HbaseResponseTimeDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.RESPONSE_TIME, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledActiveTraceDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledActiveTraceDaoV2.java deleted file mode 100644 index aeddf91790e8..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledActiveTraceDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.web.dao.stat.SampledActiveTraceDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("sampledActiveTraceDaoV2") -public class HbaseSampledActiveTraceDaoV2 - extends DefaultSampledAgentStatDao implements SampledActiveTraceDao { - - public HbaseSampledActiveTraceDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.ACTIVE_TRACE, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledCpuLoadDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledCpuLoadDaoV2.java deleted file mode 100644 index 9930b84d0e47..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledCpuLoadDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; -import com.navercorp.pinpoint.web.dao.stat.SampledCpuLoadDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("sampledCpuLoadDaoV2") -public class HbaseSampledCpuLoadDaoV2 - extends DefaultSampledAgentStatDao implements SampledCpuLoadDao { - - public HbaseSampledCpuLoadDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.CPU_LOAD, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDeadlockDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDeadlockDaoV2.java deleted file mode 100644 index d48b90450fa0..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDeadlockDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.web.dao.stat.SampledDeadlockDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledDeadlock; -import org.springframework.stereotype.Repository; - -/** - * @author Taejin Koo - */ -@Repository("sampledDeadlockDaoV2") -public class HbaseSampledDeadlockDaoV2 - extends DefaultSampledAgentStatDao implements SampledDeadlockDao { - - public HbaseSampledDeadlockDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.DEADLOCK, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDirectBufferDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDirectBufferDaoV2.java deleted file mode 100644 index c2eef6f05fcd..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledDirectBufferDaoV2.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; -import com.navercorp.pinpoint.web.dao.stat.SampledDirectBufferDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledDirectBuffer; -import org.springframework.stereotype.Repository; - -/** - * @author Roy Kim - */ -@Repository("sampledDirectBufferDaoV2") -public class HbaseSampledDirectBufferDaoV2 - extends DefaultSampledAgentStatDao implements SampledDirectBufferDao { - - - public HbaseSampledDirectBufferDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.DIRECT_BUFFER, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledFileDescriptorDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledFileDescriptorDaoV2.java deleted file mode 100644 index a2bee399a4ab..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledFileDescriptorDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; -import com.navercorp.pinpoint.web.dao.stat.SampledFileDescriptorDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor; -import org.springframework.stereotype.Repository; - -/** - * @author Roy Kim - */ -@Repository("sampledFileDescriptorDaoV2") -public class HbaseSampledFileDescriptorDaoV2 - extends DefaultSampledAgentStatDao implements SampledFileDescriptorDao { - - public HbaseSampledFileDescriptorDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.FILE_DESCRIPTOR, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDaoV2.java deleted file mode 100644 index c56f9a713a0a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; -import com.navercorp.pinpoint.web.dao.stat.SampledJvmGcDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGc; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("sampledJvmGcDaoV2") -public class HbaseSampledJvmGcDaoV2 - extends DefaultSampledAgentStatDao implements SampledJvmGcDao { - - public HbaseSampledJvmGcDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.JVM_GC, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDetailedDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDetailedDaoV2.java deleted file mode 100644 index 14389ee7000b..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledJvmGcDetailedDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; -import com.navercorp.pinpoint.web.dao.stat.SampledJvmGcDetailedDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGcDetailed; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("sampledJvmGcDetailedDaoV2") -public class HbaseSampledJvmGcDetailedDaoV2 - extends DefaultSampledAgentStatDao implements SampledJvmGcDetailedDao { - - public HbaseSampledJvmGcDetailedDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.JVM_GC_DETAILED, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledLoadedClassDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledLoadedClassDaoV2.java deleted file mode 100644 index e262a7cd25c7..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledLoadedClassDaoV2.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; -import com.navercorp.pinpoint.web.dao.stat.SampledLoadedClassCountDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledLoadedClassCount; -import org.springframework.stereotype.Repository; - -@Repository("sampledLoadedClassDaoV2") -public class HbaseSampledLoadedClassDaoV2 - extends DefaultSampledAgentStatDao implements SampledLoadedClassCountDao { - - public HbaseSampledLoadedClassDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.LOADED_CLASS, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledResponseTimeDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledResponseTimeDaoV2.java deleted file mode 100644 index 594336ff7f5c..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledResponseTimeDaoV2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; -import com.navercorp.pinpoint.web.dao.stat.SampledResponseTimeDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledResponseTime; -import org.springframework.stereotype.Repository; - -/** - * @author Taejin Koo - */ -@Repository("sampledResponseTimeDaoV2") -public class HbaseSampledResponseTimeDaoV2 - extends DefaultSampledAgentStatDao implements SampledResponseTimeDao { - - public HbaseSampledResponseTimeDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.RESPONSE_TIME, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledTransactionDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledTransactionDaoV2.java deleted file mode 100644 index fb0889a03c07..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseSampledTransactionDaoV2.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; -import com.navercorp.pinpoint.web.dao.stat.SampledTransactionDao; -import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.AgentStatSampler; -import com.navercorp.pinpoint.web.vo.stat.SampledTransaction; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("sampledTransactionDaoV2") -public class HbaseSampledTransactionDaoV2 extends DefaultSampledAgentStatDao implements SampledTransactionDao { - - public HbaseSampledTransactionDaoV2(HbaseAgentStatDaoOperationsV2 operations, - AgentStatDecoder decoder, - AgentStatSampler sampler) { - super(AgentStatType.TRANSACTION, operations, decoder, new SampledAgentStatResultExtractorSupplier<>(sampler)); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTotalThreadCountDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTotalThreadCountDaoV2.java deleted file mode 100644 index 7a07408a7774..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTotalThreadCountDaoV2.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; -import com.navercorp.pinpoint.web.dao.stat.TotalThreadCountDao; -import org.springframework.stereotype.Repository; - -@Repository("totalThreadCountDaoV2") -public class HbaseTotalThreadCountDaoV2 extends DefaultAgentStatDao implements TotalThreadCountDao { - - public HbaseTotalThreadCountDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.TOTAL_THREAD, operations, decoder); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTransactionDaoV2.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTransactionDaoV2.java deleted file mode 100644 index 53367e0f82de..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/v2/HbaseTransactionDaoV2.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.hbase.stat.v2; - -import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDecoder; -import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; -import com.navercorp.pinpoint.web.dao.stat.TransactionDao; -import org.springframework.stereotype.Repository; - -/** - * @author HyunGil Jeong - */ -@Repository("transactionDaoV2") -public class HbaseTransactionDaoV2 extends DefaultAgentStatDao implements TransactionDao { - - public HbaseTransactionDaoV2(HbaseAgentStatDaoOperationsV2 operations, AgentStatDecoder decoder) { - super(AgentStatType.TRANSACTION, operations, decoder); - } - - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ActiveTraceDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ActiveTraceDao.java deleted file mode 100644 index 2e1fd4647226..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ActiveTraceDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; - -/** - * @author HyunGil Jeong - */ -public interface ActiveTraceDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentStatDao.java index 135947b7b39a..a67de26d0042 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentStatDao.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentStatDao.java @@ -20,11 +20,14 @@ import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; import com.navercorp.pinpoint.common.server.util.time.Range; +import com.navercorp.pinpoint.web.service.stat.ChartTypeSupport; +import org.springframework.stereotype.Repository; /** * @author HyunGil Jeong */ -public interface AgentStatDao { +@Repository +public interface AgentStatDao extends ChartTypeSupport { List getAgentStatList(String agentId, Range range); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentUriStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentUriStatDao.java deleted file mode 100644 index 78c202dde168..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/AgentUriStatDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; - -/** - * @author Taejin Koo - */ -public interface AgentUriStatDao extends AgentStatDao { -} \ No newline at end of file diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/CpuLoadDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/CpuLoadDao.java deleted file mode 100644 index 5f67c703481c..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/CpuLoadDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; - -/** - * @author HyunGil Jeong - */ -public interface CpuLoadDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DataSourceDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DataSourceDao.java deleted file mode 100644 index 759ba2534fe4..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DataSourceDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; - -/** - * @author Taejin Koo - */ -public interface DataSourceDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DeadlockDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DeadlockDao.java deleted file mode 100644 index 1fe949e5f33a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DeadlockDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; - -/** - * @author Taejin Koo - */ -public interface DeadlockDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DirectBufferDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DirectBufferDao.java deleted file mode 100644 index cc4f8d101028..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/DirectBufferDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; - -/** - * @author Roy Kim - */ -public interface DirectBufferDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/FileDescriptorDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/FileDescriptorDao.java deleted file mode 100644 index 1b3870d0a2f6..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/FileDescriptorDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; - -/** - * @author Roy Kim - */ -public interface FileDescriptorDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDao.java deleted file mode 100644 index 83122bf1980a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; - -/** - * @author HyunGil Jeong - */ -public interface JvmGcDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDetailedDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDetailedDao.java deleted file mode 100644 index 90917aed4235..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/JvmGcDetailedDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; - -/** - * @author HyunGil Jeong - */ -public interface JvmGcDetailedDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/LoadedClassCountDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/LoadedClassCountDao.java deleted file mode 100644 index dc73fdb74013..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/LoadedClassCountDao.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; - -public interface LoadedClassCountDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ResponseTimeDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ResponseTimeDao.java deleted file mode 100644 index 3225fc190637..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/ResponseTimeDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; - -/** - * @author Taejin Koo - */ -public interface ResponseTimeDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledActiveTraceDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledActiveTraceDao.java deleted file mode 100644 index adbc54ddf737..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledActiveTraceDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace; - -/** - * @author HyunGil Jeong - */ -public interface SampledActiveTraceDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledAgentUriStatDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledAgentUriStatDao.java deleted file mode 100644 index 3e5dc2086254..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledAgentUriStatDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat; - -/** - * @author Taejin Koo - */ -public interface SampledAgentUriStatDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledCpuLoadDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledCpuLoadDao.java deleted file mode 100644 index 622b70890465..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledCpuLoadDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad; - -/** - * @author HyunGil Jeong - */ -public interface SampledCpuLoadDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDataSourceDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDataSourceDao.java deleted file mode 100644 index a4c8e86e51e1..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDataSourceDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList; - -/** - * @author Taejin Koo - */ -public interface SampledDataSourceDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDeadlockDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDeadlockDao.java deleted file mode 100644 index 082186bdb221..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDeadlockDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledDeadlock; - -/** - * @author Taejin Koo - */ -public interface SampledDeadlockDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDirectBufferDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDirectBufferDao.java deleted file mode 100644 index 54cbf3c23408..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledDirectBufferDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledDirectBuffer; - -/** - * @author Roy Kim - */ -public interface SampledDirectBufferDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledFileDescriptorDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledFileDescriptorDao.java deleted file mode 100644 index 6ba6accc7bda..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledFileDescriptorDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor; - -/** - * @author Roy Kim - */ -public interface SampledFileDescriptorDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDao.java deleted file mode 100644 index e3bd8545aa73..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGc; - -/** - * @author HyunGil Jeong - */ -public interface SampledJvmGcDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDetailedDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDetailedDao.java deleted file mode 100644 index 7a49d72e849c..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledJvmGcDetailedDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGcDetailed; - -/** - * @author HyunGil Jeong - */ -public interface SampledJvmGcDetailedDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledLoadedClassCountDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledLoadedClassCountDao.java deleted file mode 100644 index 45612ea7f6a3..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledLoadedClassCountDao.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledLoadedClassCount; - -public interface SampledLoadedClassCountDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledResponseTimeDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledResponseTimeDao.java deleted file mode 100644 index b6098fa6c5aa..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledResponseTimeDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledResponseTime; - -/** - * @author Taejin Koo - */ -public interface SampledResponseTimeDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTotalThreadCountDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTotalThreadCountDao.java deleted file mode 100644 index 48e9b63cb075..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTotalThreadCountDao.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledTotalThreadCount; - -public interface SampledTotalThreadCountDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTransactionDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTransactionDao.java deleted file mode 100644 index 06f0fd0d4abb..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/SampledTransactionDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.vo.stat.SampledTransaction; - -/** - * @author HyunGil Jeong - */ -public interface SampledTransactionDao extends SampledAgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TotalThreadCountDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TotalThreadCountDao.java deleted file mode 100644 index afce78f6ef1e..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TotalThreadCountDao.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; - -public interface TotalThreadCountDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TransactionDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TransactionDao.java deleted file mode 100644 index 3b27cc51c3fc..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/stat/TransactionDao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.dao.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; - -/** - * @author HyunGil Jeong - */ -public interface TransactionDao extends AgentStatDao { -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java b/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java index a9929040b325..4fc1f9c21b3a 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/AgentInfoServiceImpl.java @@ -47,7 +47,6 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -90,7 +89,8 @@ public class AgentInfoServiceImpl implements AgentInfoService { public AgentInfoServiceImpl(AgentEventService agentEventService, AgentWarningStatService agentWarningStatService, ApplicationIndexDao applicationIndexDao, AgentInfoDao agentInfoDao, AgentLifeCycleDao agentLifeCycleDao, - AgentDownloadInfoDao agentDownloadInfoDao, @Qualifier("jvmGcDaoFactory") AgentStatDao jvmGcDao) { + AgentDownloadInfoDao agentDownloadInfoDao, + AgentStatDao jvmGcDao) { this.agentEventService = Objects.requireNonNull(agentEventService, "agentEventService"); this.agentWarningStatService = Objects.requireNonNull(agentWarningStatService, "agentWarningStatService"); this.applicationIndexDao = Objects.requireNonNull(applicationIndexDao, "applicationIndexDao"); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceChartService.java deleted file mode 100644 index 33ace33e2f0e..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceChartService.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.ActiveTraceChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class ActiveTraceChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledActiveTraceDao; - - public ActiveTraceChartService(@Qualifier("sampledActiveTraceDaoFactory") SampledAgentStatDao sampledActiveTraceDao) { - this.sampledActiveTraceDao = Objects.requireNonNull(sampledActiveTraceDao, "sampledActiveTraceDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - List sampledActiveTraces = this.sampledActiveTraceDao.getSampledAgentStatList(agentId, timeWindow); - return new ActiveTraceChart(timeWindow, sampledActiveTraces); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceService.java deleted file mode 100644 index d165cb07675a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ActiveTraceService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class ActiveTraceService implements AgentStatService { - - private final AgentStatDao activeTraceDao; - - public ActiveTraceService(@Qualifier("activeTraceDaoFactory") AgentStatDao activeTraceDao) { - this.activeTraceDao = Objects.requireNonNull(activeTraceDao, "activeTraceDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.activeTraceDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatChartService.java index 28f5b7b7bfcd..3b6eedb4bc26 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatChartService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatChartService.java @@ -24,10 +24,10 @@ /** * @author HyunGil Jeong */ -public interface AgentStatChartService { +public interface AgentStatChartService extends ChartTypeSupport { - StatChart selectAgentChart(String agentId, TimeWindow timeWindow); + OUT selectAgentChart(String agentId, TimeWindow timeWindow); - List selectAgentChartList(String agentId, TimeWindow timeWindow); + List selectAgentChartList(String agentId, TimeWindow timeWindow); } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatService.java index 898d5de963a3..eb2c79f7011d 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatService.java @@ -18,12 +18,14 @@ import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; import com.navercorp.pinpoint.common.server.util.time.Range; +import org.springframework.stereotype.Service; import java.util.List; /** * @author HyunGil Jeong */ -public interface AgentStatService { + +public interface AgentStatService extends ChartTypeSupport { List selectAgentStatList(String agentId, Range range); } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatServiceConfiguration.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatServiceConfiguration.java new file mode 100644 index 000000000000..7f2617bb4075 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentStatServiceConfiguration.java @@ -0,0 +1,207 @@ +package com.navercorp.pinpoint.web.service.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; +import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; +import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; +import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; +import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; +import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; +import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; +import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; +import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; +import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; +import com.navercorp.pinpoint.loader.service.ServiceTypeRegistryService; +import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; +import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; +import com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace; +import com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat; +import com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad; +import com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList; +import com.navercorp.pinpoint.web.vo.stat.SampledDeadlock; +import com.navercorp.pinpoint.web.vo.stat.SampledDirectBuffer; +import com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor; +import com.navercorp.pinpoint.web.vo.stat.SampledJvmGc; +import com.navercorp.pinpoint.web.vo.stat.SampledJvmGcDetailed; +import com.navercorp.pinpoint.web.vo.stat.SampledLoadedClassCount; +import com.navercorp.pinpoint.web.vo.stat.SampledResponseTime; +import com.navercorp.pinpoint.web.vo.stat.SampledTotalThreadCount; +import com.navercorp.pinpoint.web.vo.stat.SampledTransaction; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.ActiveTraceChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.CpuLoadChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.DataSourceChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.DeadlockChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.DirectBufferChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.FileDescriptorChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.JvmGcChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.JvmGcDetailedChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.LoadedClassCountChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.ResponseTimeChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.TotalThreadCountChart; +import com.navercorp.pinpoint.web.vo.stat.chart.agent.TransactionChart; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class AgentStatServiceConfiguration { + + @Bean + public AgentStatChartService getAgentStatChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, ActiveTraceChart::new); + } + + @Bean + public AgentStatService getActiveTraceService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------- + + @Bean + public AgentStatChartService getCpuLoadChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, CpuLoadChart::new); + } + + @Bean() + public AgentStatService getCpuLoadService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getDeadlockChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, DeadlockChart::new); + } + + @Bean + public AgentStatService getDeadlockService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getDirectBufferChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, DirectBufferChart::new); + } + + @Bean + public AgentStatService getDirectBufferService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getFileDescriptorChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, FileDescriptorChart::new); + } + + @Bean + public AgentStatService getFileDescriptorService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getJvmGcChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, JvmGcChart::new); + } + + @Bean + public AgentStatService getJvmGcService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getJvmGcDetailedChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, JvmGcDetailedChart::new); + } + + @Bean + public AgentStatService getJvmGcDetailedService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getLoadedClassCountChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, LoadedClassCountChart::new); + } + + @Bean + public AgentStatService getLoadedClassCountService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + + //----------------------- + + @Bean + public AgentStatChartService getResponseTimeChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, ResponseTimeChart::new); + } + + @Bean + public AgentStatService getResponseTimeService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getTotalThreadCountChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, TotalThreadCountChart::new); + } + + @Bean + public AgentStatService getTotalThreadCountService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + +// @Bean + public AgentStatChartService getDataSourceChartService(SampledAgentStatDao statDao, + ServiceTypeRegistryService registry) { + return new DataSourceChartService(statDao, registry); + } + + @Bean + public AgentStatService getDataSourceService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + // @Bean + public AgentStatChartService getAgentUriStatChartService(SampledAgentStatDao statDao) { + return new AgentUriStatChartService(statDao); + } + + @Bean + public AgentStatService getAgentUriChartService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } + + //----------------------- + + @Bean + public AgentStatChartService getTransactionChartService(SampledAgentStatDao statDao) { + return new DefaultAgentStatChartService<>(statDao, TransactionChart::new); + } + + @Bean + public AgentStatService getTransactionService(AgentStatDao statDao) { + return new DefaultStatService<>(statDao); + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatChartService.java index 2e0ea0ad0bb9..42f24329f341 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatChartService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatChartService.java @@ -21,12 +21,10 @@ import com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat; import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; import com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -36,16 +34,16 @@ * @author Taejin Koo */ @Service -public class AgentUriStatChartService implements AgentStatChartService { +public class AgentUriStatChartService implements AgentStatChartService { private final SampledAgentStatDao sampledAgentUriStatDao; - public AgentUriStatChartService(@Qualifier("sampledAgentUriStatDaoFactory") SampledAgentStatDao sampledAgentUriStatDao) { + public AgentUriStatChartService(SampledAgentStatDao sampledAgentUriStatDao) { this.sampledAgentUriStatDao = Objects.requireNonNull(sampledAgentUriStatDao, "sampledAgentUriStatDao"); } @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { + public AgentUriStatChart selectAgentChart(String agentId, TimeWindow timeWindow) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(timeWindow, "timeWindow"); @@ -60,30 +58,31 @@ public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { } @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { + public List selectAgentChartList(String agentId, TimeWindow timeWindow) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(timeWindow, "timeWindow"); List sampledAgentUriStatList = sampledAgentUriStatDao.getSampledAgentStatList(agentId, timeWindow); - if (CollectionUtils.isEmpty(sampledAgentUriStatList)) { - return Arrays.asList(new AgentUriStatChart(timeWindow, Collections.emptyList())); + return List.of(new AgentUriStatChart(timeWindow, Collections.emptyList())); } else { - List result = new ArrayList<>(sampledAgentUriStatList.size()); + List result = new ArrayList<>(sampledAgentUriStatList.size()); for (SampledAgentUriStat sampledAgentUriStat : sampledAgentUriStatList) { result.add(new AgentUriStatChart(timeWindow, sampledAgentUriStat.getSampledEachUriStatBoList())); } - Collections.sort(result, new Comparator() { - @Override - public int compare(StatChart o1, StatChart o2) { - AgentUriStatChart chart1 = (AgentUriStatChart) o1; - AgentUriStatChart chart2 = (AgentUriStatChart) o2; - return Long.compare(chart2.getTotalCount(), chart1.getTotalCount()); - } - }); + result.sort(Comparator.comparing(this::getTotalCount).reversed()); return result; } } + private long getTotalCount(StatChart statChart) { + AgentUriStatChart chart = (AgentUriStatChart) statChart; + return chart.getTotalCount(); + } + + @Override + public String getChartType() { + return sampledAgentUriStatDao.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatService.java deleted file mode 100644 index 2dc6f2991087..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentUriStatService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class AgentUriStatService implements AgentStatService { - - private final AgentStatDao agentUriStatDao; - - public AgentUriStatService(@Qualifier("agentUriStatDao") AgentStatDao agentUriStatDao) { - this.agentUriStatDao = agentUriStatDao; - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.agentUriStatDao.getAgentStatList(agentId, range); - } -} - diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceImpl.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceImpl.java index 68711dfe8852..5ae90abace00 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceImpl.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceImpl.java @@ -22,7 +22,6 @@ import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; import com.navercorp.pinpoint.web.vo.timeline.inspector.AgentState; import com.navercorp.pinpoint.web.vo.timeline.inspector.AgentStatusTimelineSegment; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -44,7 +43,7 @@ public class AgentWarningStatServiceImpl implements AgentWarningStatService { private final AgentStatDao deadlockDao; - public AgentWarningStatServiceImpl(@Qualifier("deadlockDaoV2") AgentStatDao deadlockDao) { + public AgentWarningStatServiceImpl(AgentStatDao deadlockDao) { this.deadlockDao = Objects.requireNonNull(deadlockDao, "deadlockDao"); } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ChartTypeSupport.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ChartTypeSupport.java new file mode 100644 index 000000000000..79381364ee68 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ChartTypeSupport.java @@ -0,0 +1,5 @@ +package com.navercorp.pinpoint.web.service.stat; + +public interface ChartTypeSupport { + String getChartType(); +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadService.java deleted file mode 100644 index 01bc1410d4e4..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class CpuLoadService implements AgentStatService { - - private final AgentStatDao cpuLoadDao; - - public CpuLoadService(@Qualifier("cpuLoadDaoFactory") AgentStatDao cpuLoadDao) { - this.cpuLoadDao = Objects.requireNonNull(cpuLoadDao, "cpuLoadDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(cpuLoadDao, "cpuLoadDao"); - - return this.cpuLoadDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceChartService.java index 8bb7a2d8cbd4..160d26d0afa4 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceChartService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceChartService.java @@ -16,14 +16,13 @@ package com.navercorp.pinpoint.web.service.stat; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; import com.navercorp.pinpoint.loader.service.ServiceTypeRegistryService; import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; import com.navercorp.pinpoint.web.util.TimeWindow; import com.navercorp.pinpoint.web.vo.stat.SampledDataSource; import com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; import com.navercorp.pinpoint.web.vo.stat.chart.agent.DataSourceChart; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -36,19 +35,19 @@ * @author Taejin Koo */ @Service -public class DataSourceChartService implements AgentStatChartService { +public class DataSourceChartService implements AgentStatChartService { private final SampledAgentStatDao sampledDataSourceDao; private final ServiceTypeRegistryService serviceTypeRegistryService; - public DataSourceChartService(@Qualifier("sampledDataSourceDaoFactory") SampledAgentStatDao sampledDataSourceDao, + public DataSourceChartService(SampledAgentStatDao sampledDataSourceDao, ServiceTypeRegistryService serviceTypeRegistryService) { this.sampledDataSourceDao = Objects.requireNonNull(sampledDataSourceDao, "sampledDataSourceDao"); this.serviceTypeRegistryService = Objects.requireNonNull(serviceTypeRegistryService, "serviceTypeRegistryService"); } @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { + public DataSourceChart selectAgentChart(String agentId, TimeWindow timeWindow) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(timeWindow, "timeWindow"); @@ -62,17 +61,17 @@ public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { } @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { + public List selectAgentChartList(String agentId, TimeWindow timeWindow) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(timeWindow, "timeWindow"); List sampledAgentStatList = this.sampledDataSourceDao.getSampledAgentStatList(agentId, timeWindow); if (CollectionUtils.isEmpty(sampledAgentStatList)) { - List result = new ArrayList<>(1); + List result = new ArrayList<>(1); result.add(new DataSourceChart(timeWindow, Collections.emptyList(), serviceTypeRegistryService)); return result; } else { - List result = new ArrayList<>(sampledAgentStatList.size()); + List result = new ArrayList<>(sampledAgentStatList.size()); for (SampledDataSourceList sampledDataSourceList : sampledAgentStatList) { result.add(new DataSourceChart(timeWindow, sampledDataSourceList.getSampledDataSourceList(), serviceTypeRegistryService)); } @@ -80,4 +79,8 @@ public List selectAgentChartList(String agentId, TimeWindow timeWindo } } + @Override + public String getChartType() { + return AgentStatType.DATASOURCE.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceService.java deleted file mode 100644 index 541020e049c4..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DataSourceService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class DataSourceService implements AgentStatService { - - private final AgentStatDao dataSourceDao; - - public DataSourceService(@Qualifier("dataSourceDaoFactory") AgentStatDao dataSourceDao) { - this.dataSourceDao = Objects.requireNonNull(dataSourceDao, "dataSourceDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.dataSourceDao.getAgentStatList(agentId, range); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockChartService.java deleted file mode 100644 index 22ec95cdb27a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledDeadlock; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.DeadlockChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class DeadlockChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledDeadlockDao; - - public DeadlockChartService(@Qualifier("sampledDeadlockDaoFactory") SampledAgentStatDao sampledDeadlockDao) { - this.sampledDeadlockDao = Objects.requireNonNull(sampledDeadlockDao, "sampledDeadlockDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledDeadlockList = this.sampledDeadlockDao.getSampledAgentStatList(agentId, timeWindow); - return new DeadlockChart(timeWindow, sampledDeadlockList); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockService.java deleted file mode 100644 index f2c9ddddc184..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DeadlockService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class DeadlockService implements AgentStatService { - - private final AgentStatDao deadlockDao; - - public DeadlockService(@Qualifier("deadlockDaoFactory") AgentStatDao deadlockDao) { - this.deadlockDao = Objects.requireNonNull(deadlockDao, "deadlockDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.deadlockDao.getAgentStatList(agentId, range); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultAgentStatChartService.java similarity index 51% rename from web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadChartService.java rename to web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultAgentStatChartService.java index 59b0ae0a39a1..e3bb43a2ba2e 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/CpuLoadChartService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultAgentStatChartService.java @@ -18,11 +18,8 @@ import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad; +import com.navercorp.pinpoint.web.vo.stat.SampledAgentStatDataPoint; import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.CpuLoadChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; import java.util.Collections; import java.util.List; @@ -31,28 +28,33 @@ /** * @author HyunGil Jeong */ -@Service -public class CpuLoadChartService implements AgentStatChartService { +//@Service +public class DefaultAgentStatChartService implements AgentStatChartService { - private final SampledAgentStatDao sampledCpuLoadDao; + private final SampledAgentStatDao statDao; + private final SampledChartFunction chartFunction; - public CpuLoadChartService(@Qualifier("sampledCpuLoadDaoFactory") SampledAgentStatDao sampledCpuLoadDao) { - this.sampledCpuLoadDao = Objects.requireNonNull(sampledCpuLoadDao, "sampledCpuLoadDao"); + public DefaultAgentStatChartService(SampledAgentStatDao statDao, SampledChartFunction chartFunction) { + this.statDao = Objects.requireNonNull(statDao, "sampledActiveTraceDao"); + this.chartFunction = Objects.requireNonNull(chartFunction, "chartFunction"); } @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { + public OUT selectAgentChart(String agentId, TimeWindow timeWindow) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledCpuLoads = this.sampledCpuLoadDao.getSampledAgentStatList(agentId, timeWindow); - return new CpuLoadChart(timeWindow, sampledCpuLoads); + List dataPoint = this.statDao.getSampledAgentStatList(agentId, timeWindow); + return chartFunction.apply(timeWindow, dataPoint); } @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); + public List selectAgentChartList(String agentId, TimeWindow timeWindow) { + OUT agentStatChart = selectAgentChart(agentId, timeWindow); return Collections.singletonList(agentStatChart); } + @Override + public String getChartType() { + return statDao.getChartType(); + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultStatService.java similarity index 60% rename from web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcService.java rename to web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultStatService.java index 9171deb3f36b..8659acec41fa 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DefaultStatService.java @@ -16,11 +16,10 @@ package com.navercorp.pinpoint.web.service.stat; -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint; +import com.navercorp.pinpoint.common.server.bo.stat.AgentStatType; import com.navercorp.pinpoint.common.server.util.time.Range; import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; import java.util.List; import java.util.Objects; @@ -28,20 +27,25 @@ /** * @author HyunGil Jeong */ -@Service -public class JvmGcService implements AgentStatService { +public class DefaultStatService implements AgentStatService { - private final AgentStatDao jvmGcDao; + private final AgentStatDao statDao; - public JvmGcService(@Qualifier("jvmGcDaoFactory") AgentStatDao jvmGcDao) { - this.jvmGcDao = Objects.requireNonNull(jvmGcDao, "jvmGcDao"); + public DefaultStatService(AgentStatDao statDao) { + this.statDao = Objects.requireNonNull(statDao, "activeTraceDao"); } @Override - public List selectAgentStatList(String agentId, Range range) { + public List selectAgentStatList(String agentId, Range range) { Objects.requireNonNull(agentId, "agentId"); Objects.requireNonNull(range, "range"); + + return this.statDao.getAgentStatList(agentId, range); + } - return this.jvmGcDao.getAgentStatList(agentId, range); + @Override + public String getChartType() { + return this.statDao.getChartType(); } + } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferChartService.java deleted file mode 100644 index 7d7c88fa351a..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledDirectBuffer; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.DirectBufferChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author Roy Kim - */ -@Service -public class DirectBufferChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledDirectBufferDao; - - public DirectBufferChartService(@Qualifier("sampledDirectBufferDaoFactory") SampledAgentStatDao sampledDirectBufferDao) { - this.sampledDirectBufferDao = Objects.requireNonNull(sampledDirectBufferDao, "sampledDirectBufferDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledDirectBuffers = this.sampledDirectBufferDao.getSampledAgentStatList(agentId, timeWindow); - return new DirectBufferChart(timeWindow, sampledDirectBuffers); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferService.java deleted file mode 100644 index 582aacfe4caa..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/DirectBufferService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Roy Kim - */ -@Service -public class DirectBufferService implements AgentStatService { - - private final AgentStatDao directBufferDao; - - public DirectBufferService(@Qualifier("directBufferDaoFactory") AgentStatDao directBufferDao) { - this.directBufferDao = Objects.requireNonNull(directBufferDao, "directBufferDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.directBufferDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorChartService.java deleted file mode 100644 index 24cc05d6f8af..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.FileDescriptorChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author Roy Kim - */ -@Service -public class FileDescriptorChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledFileDescriptorDao; - - public FileDescriptorChartService(@Qualifier("sampledFileDescriptorDaoFactory") SampledAgentStatDao sampledFileDescriptorDao) { - this.sampledFileDescriptorDao = Objects.requireNonNull(sampledFileDescriptorDao, "sampledFileDescriptorDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledFileDescriptors = this.sampledFileDescriptorDao.getSampledAgentStatList(agentId, timeWindow); - return new FileDescriptorChart(timeWindow, sampledFileDescriptors); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorService.java deleted file mode 100644 index 301435240e42..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/FileDescriptorService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2018 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Roy Kim - */ -@Service -public class FileDescriptorService implements AgentStatService { - - private final AgentStatDao fileDescriptorDao; - - public FileDescriptorService(@Qualifier("fileDescriptorDaoFactory") AgentStatDao fileDescriptorDao) { - this.fileDescriptorDao = Objects.requireNonNull(fileDescriptorDao, "fileDescriptorDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.fileDescriptorDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcChartService.java deleted file mode 100644 index 8c3f86d352f8..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcChartService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGc; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.JvmGcChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class JvmGcChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledJvmGcDao; - - public JvmGcChartService(@Qualifier("sampledJvmGcDaoFactory") SampledAgentStatDao sampledJvmGcDao) { - this.sampledJvmGcDao = Objects.requireNonNull(sampledJvmGcDao, "sampledJvmGcDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledJvmGcs = this.sampledJvmGcDao.getSampledAgentStatList(agentId, timeWindow); - - return new JvmGcChart(timeWindow, sampledJvmGcs); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} \ No newline at end of file diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedChartService.java deleted file mode 100644 index 89e576fa58eb..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledJvmGcDetailed; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.JvmGcDetailedChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class JvmGcDetailedChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledJvmGcDetailedDao; - - public JvmGcDetailedChartService(@Qualifier("sampledJvmGcDetailedDaoFactory") SampledAgentStatDao sampledJvmGcDetailedDao) { - this.sampledJvmGcDetailedDao = Objects.requireNonNull(sampledJvmGcDetailedDao, "sampledJvmGcDetailedDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledJvmGcDetaileds = this.sampledJvmGcDetailedDao.getSampledAgentStatList(agentId, timeWindow); - return new JvmGcDetailedChart(timeWindow, sampledJvmGcDetaileds); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedService.java deleted file mode 100644 index 72db47e10f64..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/JvmGcDetailedService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class JvmGcDetailedService implements AgentStatService { - - private final AgentStatDao jvmGcDetailedDao; - - public JvmGcDetailedService(@Qualifier("jvmGcDetailedDaoFactory") AgentStatDao jvmGcDetailedDao) { - this.jvmGcDetailedDao = Objects.requireNonNull(jvmGcDetailedDao, "jvmGcDetailedDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.jvmGcDetailedDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountChartService.java deleted file mode 100644 index de6a2045a314..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountChartService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledLoadedClassCount; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.LoadedClassCountChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -@Service -public class LoadedClassCountChartService implements AgentStatChartService{ - private final SampledAgentStatDao sampledLoadedClassCountDao; - - public LoadedClassCountChartService(@Qualifier("sampledLoadedClassCountDaoFactory") SampledAgentStatDao sampledLoadedClassCountDao) { - this.sampledLoadedClassCountDao = Objects.requireNonNull(sampledLoadedClassCountDao, "sampledLoadedClassCountDao"); - } - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - List sampledLoadedClassCounts = this.sampledLoadedClassCountDao.getSampledAgentStatList(agentId, timeWindow); - return new LoadedClassCountChart(timeWindow, sampledLoadedClassCounts); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountService.java deleted file mode 100644 index 936ce8989610..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/LoadedClassCountService.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -@Service -public class LoadedClassCountService implements AgentStatService { - private final AgentStatDao loadedClassCountDao; - - public LoadedClassCountService(@Qualifier("loadedClassCountDaoFactory") AgentStatDao loadedClassCountDao) { - this.loadedClassCountDao = Objects.requireNonNull(loadedClassCountDao, "loadedClassCountDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - return this.loadedClassCountDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeChartService.java deleted file mode 100644 index 0817109bf935..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledResponseTime; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.ResponseTimeChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class ResponseTimeChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledResponseTimeDao; - - public ResponseTimeChartService(@Qualifier("sampledResponseTimeDaoFactory") SampledAgentStatDao sampledResponseTimeDao) { - this.sampledResponseTimeDao = Objects.requireNonNull(sampledResponseTimeDao, "sampledResponseTimeDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledResponseTimes = this.sampledResponseTimeDao.getSampledAgentStatList(agentId, timeWindow); - return new ResponseTimeChart(timeWindow, sampledResponseTimes); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeService.java deleted file mode 100644 index 496d287493ca..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ResponseTimeService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author Taejin Koo - */ -@Service -public class ResponseTimeService implements AgentStatService { - - private final AgentStatDao responseTimeDao; - - public ResponseTimeService(@Qualifier("responseTimeDaoFactory") AgentStatDao responseTimeDao) { - this.responseTimeDao = Objects.requireNonNull(responseTimeDao, "responseTimeDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.responseTimeDao.getAgentStatList(agentId, range); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/SampledChartFunction.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/SampledChartFunction.java new file mode 100644 index 000000000000..7ca122390a20 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/SampledChartFunction.java @@ -0,0 +1,12 @@ +package com.navercorp.pinpoint.web.service.stat; + +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.stat.SampledAgentStatDataPoint; +import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; + +import java.util.List; + +@FunctionalInterface +public interface SampledChartFunction { + OUT apply(TimeWindow timeWindow, List applicationStatList); +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountChartService.java deleted file mode 100644 index 4f11359c867b..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountChartService.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledTotalThreadCount; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.TotalThreadCountChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -@Service -public class TotalThreadCountChartService implements AgentStatChartService{ - private final SampledAgentStatDao sampledTotalThreadCountDao; - - public TotalThreadCountChartService(@Qualifier("sampledTotalThreadCountDaoFactory") SampledAgentStatDao sampledTotalThreadCountDao) { - this.sampledTotalThreadCountDao = Objects.requireNonNull(sampledTotalThreadCountDao, "sampledTotalThreadCountDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - List sampledTotalThreadCounts = this.sampledTotalThreadCountDao.getSampledAgentStatList(agentId, timeWindow); - return new TotalThreadCountChart(timeWindow, sampledTotalThreadCounts); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountService.java deleted file mode 100644 index d72248853d6b..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TotalThreadCountService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -@Service -public class TotalThreadCountService implements AgentStatService { - private final AgentStatDao totalThreadCountDao; - - public TotalThreadCountService(@Qualifier("totalThreadCountDaoFactory") AgentStatDao totalThreadCountDao) { - this.totalThreadCountDao = Objects.requireNonNull(totalThreadCountDao); - } - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range,"range"); - return this.totalThreadCountDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionChartService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionChartService.java deleted file mode 100644 index b38dce56f6a1..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionChartService.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.web.dao.SampledAgentStatDao; -import com.navercorp.pinpoint.web.util.TimeWindow; -import com.navercorp.pinpoint.web.vo.stat.SampledTransaction; -import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; -import com.navercorp.pinpoint.web.vo.stat.chart.agent.TransactionChart; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class TransactionChartService implements AgentStatChartService { - - private final SampledAgentStatDao sampledTransactionDao; - - public TransactionChartService(@Qualifier("sampledTransactionDaoFactory") SampledAgentStatDao sampledTransactionDao) { - this.sampledTransactionDao = Objects.requireNonNull(sampledTransactionDao, "sampledTransactionDao"); - } - - @Override - public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(timeWindow, "timeWindow"); - - List sampledTransactions = this.sampledTransactionDao.getSampledAgentStatList(agentId, timeWindow); - return new TransactionChart(timeWindow, sampledTransactions); - } - - @Override - public List selectAgentChartList(String agentId, TimeWindow timeWindow) { - StatChart agentStatChart = selectAgentChart(agentId, timeWindow); - return Collections.singletonList(agentStatChart); - } - -} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionService.java deleted file mode 100644 index 76466a0d6e8c..000000000000 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/TransactionService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Naver Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.navercorp.pinpoint.web.service.stat; - -import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; -import com.navercorp.pinpoint.common.server.util.time.Range; -import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; - -/** - * @author HyunGil Jeong - */ -@Service -public class TransactionService implements AgentStatService { - - private final AgentStatDao transactionDao; - - public TransactionService(@Qualifier("transactionDaoFactory") AgentStatDao transactionDao) { - this.transactionDao = Objects.requireNonNull(transactionDao, "transactionDao"); - } - - @Override - public List selectAgentStatList(String agentId, Range range) { - Objects.requireNonNull(agentId, "agentId"); - Objects.requireNonNull(range, "range"); - - return this.transactionDao.getAgentStatList(agentId, range); - } -} diff --git a/web/src/test/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceTest.java b/web/src/test/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceTest.java index 31c5e9c9bfdc..43f6d1bf2049 100644 --- a/web/src/test/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceTest.java +++ b/web/src/test/java/com/navercorp/pinpoint/web/service/stat/AgentWarningStatServiceTest.java @@ -17,7 +17,7 @@ package com.navercorp.pinpoint.web.service.stat; import com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo; -import com.navercorp.pinpoint.web.dao.stat.DeadlockDao; +import com.navercorp.pinpoint.web.dao.stat.AgentStatDao; import com.navercorp.pinpoint.common.server.util.time.Range; import com.navercorp.pinpoint.web.vo.timeline.inspector.AgentStatusTimelineSegment; import org.junit.Assert; @@ -45,7 +45,7 @@ public class AgentWarningStatServiceTest { private static final long TIME = 60000 * 5; @Mock - private DeadlockDao deadlockDao; + private AgentStatDao deadlockDao; private AgentWarningStatService agentWarningStatService;