|
|
@ -29,7 +29,7 @@ public class GraphService { |
|
|
private final static Logger logger = LoggerFactory.getLogger(GraphService.class); |
|
|
private final static Logger logger = LoggerFactory.getLogger(GraphService.class); |
|
|
|
|
|
|
|
|
@Scheduled(cron = "@hourly") |
|
|
@Scheduled(cron = "@hourly") |
|
|
@CacheEvict(value = "graphs", allEntries = true) |
|
|
@CacheEvict(value = {"graphs.usertime", "graphs.vip", "graphs.online"}, allEntries = true) |
|
|
public void purgeCache() { |
|
|
public void purgeCache() { |
|
|
logger.info("Cache clean"); |
|
|
logger.info("Cache clean"); |
|
|
} |
|
|
} |
|
|
@ -43,7 +43,7 @@ public class GraphService { |
|
|
* @param searchFilter |
|
|
* @param searchFilter |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Cacheable(value = "graphs", key = "#searchFilter.cacheKey") |
|
|
@Cacheable(value = "graphs.usertime", key = "#searchFilter.cacheKey") //"graphs.usertime", "graphs.vip"
|
|
|
public List<PerPeriodStatistic> getUsertimeOnPeriod(SearchFilter searchFilter) { |
|
|
public List<PerPeriodStatistic> getUsertimeOnPeriod(SearchFilter searchFilter) { |
|
|
final String sql = "select date_trunc(:delta, timestamp) AS ts, :delta as period, sum(connect_duration) as value, srv_id from user_connections " + |
|
|
final String sql = "select date_trunc(:delta, timestamp) AS ts, :delta as period, sum(connect_duration) as value, srv_id from user_connections " + |
|
|
"where (:account_ids_empty = true or account_id in (:account_ids)) and connect_duration != 0 and timestamp between :begindate and :enddate " + |
|
|
"where (:account_ids_empty = true or account_id in (:account_ids)) and connect_duration != 0 and timestamp between :begindate and :enddate " + |
|
|
@ -74,7 +74,7 @@ public class GraphService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Cacheable(value = "graphs", key = "#searchFilter.cacheKey") |
|
|
@Cacheable(value = "graphs.vip", key = "#searchFilter.cacheKey") |
|
|
public List<VipPerPeriodStatistic> getVipOnPeriod(SearchFilter searchFilter) { |
|
|
public List<VipPerPeriodStatistic> getVipOnPeriod(SearchFilter searchFilter) { |
|
|
final String sql = "select date_trunc(:delta, timestamp) AS ts, :delta as period, count(*) as value, givemethod, amount from gived_vip " + |
|
|
final String sql = "select date_trunc(:delta, timestamp) AS ts, :delta as period, count(*) as value, givemethod, amount from gived_vip " + |
|
|
"where (:account_ids_empty = true or steam2 in (:account_ids)) and givemethod != 4 and timestamp between :begindate and :enddate " + |
|
|
"where (:account_ids_empty = true or steam2 in (:account_ids)) and givemethod != 4 and timestamp between :begindate and :enddate " + |
|
|
|