Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Develop #28

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public List<StatisticContent> findStatistics(Long eserviceRecordId, Integer poll
+ "SELECT binned_timestamp, status, avg_response_time "
+ "FROM "
//this select with the where condition on seqnum deletes all the duplicates time that will be created with the approximation keeping the lowest time
+ "(SELECT * , row_number() over (partition by binned_timestamp order by binned_timestamp desc) as seqnum FROM "
+ "(SELECT eservice_record_id ,status,bin(time,"+ (pollingFrequency * months) +"m) as binned_timestamp, cast(avg(response_time) as int) as avg_response_time "
+ "(SELECT * , row_number() over (partition by binned_timestamp order by binned_timestamp desc,num_status desc) as seqnum FROM "
+ "(SELECT eservice_record_id ,status,bin(time,"+ (pollingFrequency * months) +"m) as binned_timestamp, cast(avg(response_time) as int) as avg_response_time,count(status) as num_status "
+ "FROM " + database + "." + table + " "
+ "WHERE time between "
+ (Objects.nonNull(startDate) ? "'" + startDate.format(DateTimeFormatter.ofPattern(TIME_FORMAT)) + "' " : "ago(1d) ")
Expand Down
Loading