use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class ResponseTimeChartGroupTest method basicFunctionTest1.
@Test
public void basicFunctionTest1() throws Exception {
long currentTimeMillis = System.currentTimeMillis();
TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
List<SampledResponseTime> sampledResponseTimeList = createSampledResponseTimeList(timeWindow);
StatChartGroup responseTimeChartGroup = new ResponseTimeChart.ResponseTimeChartGroup(timeWindow, sampledResponseTimeList);
assertEquals(sampledResponseTimeList, responseTimeChartGroup);
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class TimeSeriesChartBuilderTest method empty.
@Test
public void empty() {
// Given
int numSlots = 10;
TimeWindow timeWindow = new TimeWindow(Range.newRange(0, TIME_WINDOW_SIZE * numSlots), TIME_WINDOW_SAMPLER);
TimeSeriesChartBuilder<TestPoint> builder = new TimeSeriesChartBuilder<>(timeWindow, TestPoint.UNCOLLECTED_POINT_CREATOR);
List<TestPoint> points = Collections.emptyList();
// When
Chart<TestPoint> chart = builder.build(points);
// Then
List<TestPoint> sampledPoints = chart.getPoints();
Assert.assertTrue(sampledPoints.isEmpty());
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class HbaseMapStatisticsCallerDao method selectCaller.
@Override
public LinkDataMap selectCaller(Application callerApplication, Range range) {
Objects.requireNonNull(callerApplication, "callerApplication");
Objects.requireNonNull(range, "range");
final TimeWindow timeWindow = new TimeWindow(range, TimeWindowDownSampler.SAMPLER);
// find distributed key.
final Scan scan = createScan(callerApplication, range, DESCRIPTOR.getName());
ResultsExtractor<LinkDataMap> resultExtractor = new RowMapReduceResultExtractor<>(mapStatisticsCallerMapper, new MapStatisticsTimeWindowReducer(timeWindow));
TableName mapStatisticsCalleeTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
LinkDataMap linkDataMap = this.hbaseTemplate.findParallel(mapStatisticsCalleeTableName, scan, rowKeyDistributorByHashPrefix, resultExtractor, MAP_STATISTICS_CALLEE_VER2_NUM_PARTITIONS);
logger.debug("tableInfo({}). Caller data. {}, {} : ", mapStatisticsCalleeTableName.getNameAsString(), linkDataMap, range);
if (linkDataMap != null && linkDataMap.size() > 0) {
return linkDataMap;
}
return new LinkDataMap();
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class AgentStatController method getAgentStatChart.
@GetMapping(value = "/chart")
public StatChart getAgentStatChart(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to) {
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler();
TimeWindow timeWindow = new TimeWindow(Range.newRange(from, to), sampler);
return this.agentStatChartService.selectAgentChart(agentId, timeWindow);
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class AgentStatController method getAgentStatChartList.
@GetMapping(value = "/chartList")
public List<StatChart> getAgentStatChartList(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to) {
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler();
TimeWindow timeWindow = new TimeWindow(Range.newRange(from, to), sampler);
return this.agentStatChartService.selectAgentChartList(agentId, timeWindow);
}
Aggregations