use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.
the class MapController method getResponseTimeHistogramData.
@RequestMapping(value = "/getResponseTimeHistogramData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public ApplicationTimeHistogramViewModel getResponseTimeHistogramData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to) {
final Range range = new Range(from, to);
dateLimit.limit(range);
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);
ApplicationTimeHistogramViewModel applicationTimeHistogramViewModel = mapService.selectResponseTimeHistogramData(application, range);
return applicationTimeHistogramViewModel;
}
use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.
the class AgentStatController method getAgentStatChartList.
@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/chartList", method = RequestMethod.GET)
@ResponseBody
public List<AgentStatChartGroup> getAgentStatChartList(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to) {
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler();
TimeWindow timeWindow = new TimeWindow(new Range(from, to), sampler);
return this.agentStatChartService.selectAgentChartList(agentId, timeWindow);
}
use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.
the class AgentStatisticsController method insertAgentCount.
@RequestMapping(value = "/insertAgentCount", method = RequestMethod.GET, params = { "agentCount", "timestamp" })
@ResponseBody
public Map<String, String> insertAgentCount(@RequestParam("agentCount") int agentCount, @RequestParam("timestamp") long timestamp) {
if (timestamp < 0) {
Map<String, String> result = new HashMap<>();
result.put("result", "FAIL");
result.put("message", "negative timestamp.");
return result;
}
AgentCountStatistics agentCountStatistics = new AgentCountStatistics(agentCount, DateUtils.timestampToMidNight(timestamp));
boolean success = agentStatisticsService.insertAgentCount(agentCountStatistics);
if (success) {
Map<String, String> result = new HashMap<>();
result.put("result", "SUCCESS");
return result;
} else {
Map<String, String> result = new HashMap<>();
result.put("result", "FAIL");
result.put("message", "insert DAO error.");
return result;
}
}
use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.
the class AgentStatisticsController method selectAgentCount.
@RequestMapping(value = "/selectAgentCount", method = RequestMethod.GET, params = { "from", "to" })
@ResponseBody
public List<AgentCountStatistics> selectAgentCount(@RequestParam("from") long from, @RequestParam("to") long to) {
Range range = new Range(DateUtils.timestampToMidNight(from), DateUtils.timestampToMidNight(to), true);
List<AgentCountStatistics> agentCountStatisticsList = agentStatisticsService.selectAgentCount(range);
Collections.sort(agentCountStatisticsList, new Comparator<AgentCountStatistics>() {
@Override
public int compare(AgentCountStatistics o1, AgentCountStatistics o2) {
if (o1.getTimestamp() > o2.getTimestamp()) {
return -1;
} else {
return 1;
}
}
});
return agentCountStatisticsList;
}
use of org.springframework.web.bind.annotation.ResponseBody in project goci by EBISPOT.
the class PussycatGOCIController method renderAssociations.
@RequestMapping(value = "/gwasdiagram/associations")
@ResponseBody
public String renderAssociations(@RequestParam(value = "pvaluemin", required = false) String pvalueMin, @RequestParam(value = "pvaluemax", required = false) String pvalueMax, @RequestParam(value = "datemin", required = false) String dateMin, @RequestParam(value = "datemax", required = false) String dateMax, HttpSession session) throws PussycatSessionNotReadyException, NoRenderableDataException {
getLog().debug("Received a new rendering request - " + "putting together the query from date '" + dateMin + "' to '" + dateMax + "' and from pvalue '" + pvalueMin + "' to '" + pvalueMax + "'");
if (pvalueMin == "") {
pvalueMin = null;
}
if (pvalueMax == "") {
pvalueMax = null;
}
if (dateMin == "") {
dateMin = null;
}
if (dateMax == "") {
dateMax = null;
}
Filter pvalueFilter = null;
Filter dateFilter = null;
if (pvalueMin != null || pvalueMax != null) {
pvalueFilter = setPvalueFilter(pvalueMin, pvalueMax);
getRenderletNexus(session).setRenderingContext(pvalueFilter);
}
if (dateMin != null || dateMax != null) {
dateFilter = setDateFilter(dateMin, dateMax);
getRenderletNexus(session).setRenderingContext(dateFilter);
}
if (dateFilter == null && pvalueFilter == null) {
return getPussycatSession(session).performRendering(getRenderletNexus(session));
} else if (dateFilter == null && pvalueFilter != null) {
return getPussycatSession(session).performRendering(getRenderletNexus(session), pvalueFilter);
} else if (pvalueFilter == null && dateFilter != null) {
return getPussycatSession(session).performRendering(getRenderletNexus(session), dateFilter);
} else {
return getPussycatSession(session).performRendering(getRenderletNexus(session), dateFilter, pvalueFilter);
}
}
Aggregations