forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#9942] Add uri stat charts
- Loading branch information
Showing
30 changed files
with
896 additions
and
376 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatApdexChart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import com.navercorp.pinpoint.uristat.web.dao.UriStatChartDao; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Component | ||
public class UriStatApdexChart extends UriStatChartType { | ||
private final static List<String> fieldNames = Arrays.asList("apdex"); | ||
|
||
public UriStatApdexChart(@Qualifier("pinotApdexChartDao") UriStatChartDao chartDao) { | ||
this.type = "apdex"; | ||
this.chartDao = Objects.requireNonNull(chartDao, "chartDao"); | ||
} | ||
|
||
@Override | ||
public List<String> getFieldNames() { | ||
return fieldNames; | ||
} | ||
|
||
@Override | ||
public UriStatChartDao getChartDao() { | ||
return chartDao; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatChartType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import com.navercorp.pinpoint.uristat.web.dao.UriStatChartDao; | ||
|
||
import java.util.List; | ||
|
||
public abstract class UriStatChartType { | ||
protected String type; | ||
protected UriStatChartDao chartDao; | ||
|
||
public abstract List<String> getFieldNames(); | ||
|
||
public abstract UriStatChartDao getChartDao(); | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...t-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatChartTypeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Component | ||
public class UriStatChartTypeFactory { | ||
private final List<UriStatChartType> uriStatCharts; | ||
|
||
public UriStatChartTypeFactory(UriStatChartType... uriStatCharts) { | ||
Objects.requireNonNull(uriStatCharts, "uriStatCharts"); | ||
this.uriStatCharts = List.of(uriStatCharts); | ||
} | ||
|
||
public UriStatChartType valueOf(String type) { | ||
Objects.requireNonNull(type); | ||
for (UriStatChartType chart : uriStatCharts) { | ||
if (type.equals(chart.getType())) { | ||
return chart; | ||
} | ||
} | ||
throw new RuntimeException("Invalid uri stat chart type: " + type); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...istat-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatFailureChart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import com.navercorp.pinpoint.uristat.web.dao.UriStatChartDao; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Component | ||
public class UriStatFailureChart extends UriStatChartType { | ||
private final static List<String> fieldNames = Arrays.asList("0 ~ 100ms", "100 ~ 300ms", "300 ~ 500ms", "500 ~ 1000ms", "1000 ~ 3000ms", "3000 ~ 5000ms", "5000 ~ 8000ms", "8000ms ~"); | ||
|
||
public UriStatFailureChart(@Qualifier("pinotFailureCountChartDao") UriStatChartDao chartDao) { | ||
this.type = "failure"; | ||
this.chartDao = Objects.requireNonNull(chartDao, "chartDao"); | ||
} | ||
|
||
@Override | ||
public List<String> getFieldNames() { | ||
return fieldNames; | ||
} | ||
|
||
@Override | ||
public UriStatChartDao getChartDao() { | ||
return chartDao; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...istat-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatLatencyChart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import com.navercorp.pinpoint.uristat.web.dao.UriStatChartDao; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Component | ||
public class UriStatLatencyChart extends UriStatChartType { | ||
private final static List<String> fieldNames = Arrays.asList("avg", "max"); | ||
|
||
public UriStatLatencyChart(@Qualifier("pinotLatencyChartDao") UriStatChartDao chartDao) { | ||
this.type = "latency"; | ||
this.chartDao = Objects.requireNonNull(chartDao, "chartDao"); | ||
} | ||
|
||
@Override | ||
public List<String> getFieldNames() { | ||
return fieldNames; | ||
} | ||
|
||
@Override | ||
public UriStatChartDao getChartDao() { | ||
return chartDao; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/chart/UriStatTotalChart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.navercorp.pinpoint.uristat.web.chart; | ||
|
||
import com.navercorp.pinpoint.uristat.web.dao.UriStatChartDao; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Component | ||
public class UriStatTotalChart extends UriStatChartType { | ||
private final static List<String> fieldNames = Arrays.asList("0 ~ 100ms", "100 ~ 300ms", "300 ~ 500ms", "500 ~ 1000ms", "1000 ~ 3000ms", "3000 ~ 5000ms", "5000 ~ 8000ms", "8000ms ~"); | ||
|
||
public UriStatTotalChart(@Qualifier("pinotTotalCountChartDao") UriStatChartDao chartDao) { | ||
this.type = "total"; | ||
this.chartDao = Objects.requireNonNull(chartDao, "chartDao"); | ||
} | ||
|
||
@Override | ||
public List<String> getFieldNames() { | ||
return fieldNames; | ||
} | ||
|
||
@Override | ||
public UriStatChartDao getChartDao() { | ||
return chartDao; | ||
} | ||
} |
10 changes: 6 additions & 4 deletions
10
...istat-web/src/main/java/com/navercorp/pinpoint/uristat/web/config/UriRegistryHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
.../uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/dao/PinotApdexChartDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.navercorp.pinpoint.uristat.web.dao; | ||
|
||
import com.navercorp.pinpoint.uristat.web.model.UriStatChartValue; | ||
import com.navercorp.pinpoint.uristat.web.util.UriStatChartQueryParameter; | ||
import org.mybatis.spring.SqlSessionTemplate; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Repository | ||
public class PinotApdexChartDao implements UriStatChartDao { | ||
private static final String NAMESPACE = UriStatChartDao.class.getName() + "."; | ||
|
||
private final SqlSessionTemplate sqlPinotSessionTemplate; | ||
|
||
public PinotApdexChartDao(@Qualifier("uriStatPinotSessionTemplate") SqlSessionTemplate sqlPinotSessionTemplate) { | ||
this.sqlPinotSessionTemplate = Objects.requireNonNull(sqlPinotSessionTemplate, "sqlPinotSessionTemplate"); | ||
} | ||
|
||
@Override | ||
public List<UriStatChartValue> getChartDataApplication(UriStatChartQueryParameter queryParameter) { | ||
return sqlPinotSessionTemplate.selectList(NAMESPACE + "selectUriApdexApplication", queryParameter); | ||
} | ||
|
||
@Override | ||
public List<UriStatChartValue> getChartDataAgent(UriStatChartQueryParameter queryParameter) { | ||
return sqlPinotSessionTemplate.selectList(NAMESPACE + "selectUriApdexAgent", queryParameter); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...t-web/src/main/java/com/navercorp/pinpoint/uristat/web/dao/PinotFailureCountChartDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.navercorp.pinpoint.uristat.web.dao; | ||
|
||
import com.navercorp.pinpoint.uristat.web.model.UriStatChartValue; | ||
import com.navercorp.pinpoint.uristat.web.util.UriStatChartQueryParameter; | ||
import org.mybatis.spring.SqlSessionTemplate; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Repository | ||
public class PinotFailureCountChartDao implements UriStatChartDao { | ||
private static final String NAMESPACE = UriStatChartDao.class.getName() + "."; | ||
|
||
private final SqlSessionTemplate sqlPinotSessionTemplate; | ||
|
||
public PinotFailureCountChartDao(@Qualifier("uriStatPinotSessionTemplate") SqlSessionTemplate sqlPinotSessionTemplate) { | ||
this.sqlPinotSessionTemplate = Objects.requireNonNull(sqlPinotSessionTemplate, "sqlPinotSessionTemplate"); | ||
} | ||
|
||
@Override | ||
public List<UriStatChartValue> getChartDataApplication(UriStatChartQueryParameter queryParameter) { | ||
return sqlPinotSessionTemplate.selectList(NAMESPACE + "selectFailedUriStatApplication", queryParameter); | ||
} | ||
|
||
@Override | ||
public List<UriStatChartValue> getChartDataAgent(UriStatChartQueryParameter queryParameter) { | ||
return sqlPinotSessionTemplate.selectList(NAMESPACE + "selectFailedUriStatAgentId", queryParameter); | ||
} | ||
} |
Oops, something went wrong.