Skip to content

Commit

Permalink
0004908: Added option to reset row replication statistics (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Mar 22, 2021
1 parent 11e5771 commit 0899ffd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Expand Up @@ -45,6 +45,8 @@ public interface IStatisticService {

public TreeMap<Date, Map<String, ChannelStats>> getChannelStatsForPeriod(Date start, Date end, String nodeId, int periodSizeInMinutes);

public void deleteChannelStatsForPeriod(Date start, Date end, String nodeId);

public TreeMap<Date, Map<String, ChannelStats>> getNodeStatsForPeriod(Date start, Date end, String nodeId, int periodSizeInMinutes);

public TreeMap<Date, HostStats> getHostStatsForPeriod(Date start, Date end, String nodeId, int periodSizeInMinutes);
Expand Down
Expand Up @@ -90,6 +90,10 @@ public TreeMap<Date, Map<String, ChannelStats>> getChannelStatsForPeriod(Date st
new ChannelStatsMapper(), start, end, nodeId);
return new ChannelStatsByPeriodMap(start, end, list, periodSizeInMinutes);
}

public void deleteChannelStatsForPeriod(Date start, Date end, String nodeId) {
sqlTemplate.update(getSql("deleteChannelStatsSql"), start, end, nodeId);
}

public TreeMap<Date, Map<String, ChannelStats>> getNodeStatsForPeriod(Date start, Date end,
String nodeId, int periodSizeInMinutes) {
Expand Down
Expand Up @@ -49,6 +49,11 @@ public StatisticServiceSqlMap(IDatabasePlatform platform, Map<String, String> re
" from $(node_host_channel_stats) " +
" where start_time >= ? and end_time <= ? and node_id=? order by start_time asc " );

putSql("deleteChannelStatsSql" , "" +
"delete " +
" from $(node_host_channel_stats) " +
" where start_time >= ? and end_time <= ? and node_id=?");

putSql("selectNodeStatsSql", "" +
"select node_id, start_time, end_time, " +
" sum(data_routed) as data_routed, sum(data_unrouted) as data_unrouted, " +
Expand Down

0 comments on commit 0899ffd

Please sign in to comment.