Skip to content

Commit

Permalink
Merge pull request #1 from nickidw/reportsorting
Browse files Browse the repository at this point in the history
Added sorting on duplicate_count
  • Loading branch information
nickidw authored Jun 22, 2024
2 parents d37b553 + 6fb81a6 commit a1d29cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alerta/database/backends/postgres/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def get_topn_count(self, query=None, topn=100):
FROM alerts, UNNEST (service) svc
WHERE {where}
GROUP BY {group}
ORDER BY count DESC
ORDER BY count DESC, duplicate_count DESC
""".format(where=query.where, group=group)
return [
{
Expand All @@ -590,7 +590,7 @@ def get_topn_flapping(self, query=None, topn=100):
FROM topn, UNNEST (service) svc, UNNEST (history) hist
WHERE hist.type='severity'
GROUP BY topn.{group}
ORDER BY count DESC
ORDER BY count DESC, duplicate_count DESC
""".format(where=query.where, group=group)
return [
{
Expand Down

0 comments on commit a1d29cf

Please sign in to comment.