use of com.sohu.cache.web.chart.model.SimpleChartData in project cachecloud by sohutv.
the class AppController method assembleJson.
private String assembleJson(List<AppCommandStats> appCommandStatsList, Integer addDay) {
if (appCommandStatsList == null || appCommandStatsList.isEmpty()) {
return "[]";
}
List<SimpleChartData> list = new ArrayList<SimpleChartData>();
for (AppCommandStats stat : appCommandStatsList) {
try {
SimpleChartData chartData = SimpleChartData.getFromAppCommandStats(stat, addDay);
list.add(chartData);
} catch (ParseException e) {
logger.info(e.getMessage(), e);
}
}
JSONArray jsonArray = JSONArray.fromObject(list);
return jsonArray.toString();
}
use of com.sohu.cache.web.chart.model.SimpleChartData in project cachecloud by sohutv.
the class AppController method assembleAppStatsJson.
/**
* AppStats列表组装成json串
*/
private String assembleAppStatsJson(List<AppStats> appStats, String statName) {
if (appStats == null || appStats.isEmpty()) {
return "[]";
}
List<SimpleChartData> list = new ArrayList<SimpleChartData>();
for (AppStats stat : appStats) {
try {
SimpleChartData chartData = SimpleChartData.getFromAppStats(stat, statName);
list.add(chartData);
} catch (ParseException e) {
logger.info(e.getMessage(), e);
}
}
JSONArray jsonArray = JSONArray.fromObject(list);
return jsonArray.toString();
}
use of com.sohu.cache.web.chart.model.SimpleChartData in project cachecloud by sohutv.
the class AppController method assembleGroupJson.
/**
* AppCommandGroup列表组装成json串
*/
private String assembleGroupJson(List<AppCommandGroup> appCommandGroupList) {
if (appCommandGroupList == null || appCommandGroupList.isEmpty()) {
return "[]";
}
List<SimpleChartData> list = new ArrayList<SimpleChartData>();
for (AppCommandGroup appCommandGroup : appCommandGroupList) {
SimpleChartData chartData = SimpleChartData.getFromAppCommandGroup(appCommandGroup);
list.add(chartData);
}
JSONArray jsonArray = JSONArray.fromObject(list);
return jsonArray.toString();
}
Aggregations