Skip to content

Commit

Permalink
Fixed error with slow_queries method - fixes #489
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 20, 2024
1 parent 2169a5c commit 488972a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.4.2 (unreleased)

- Fixed error with `slow_queries` method

## 3.4.1 (2024-02-07)

- Added current stats to query details page
Expand Down
2 changes: 1 addition & 1 deletion lib/pghero/methods/query_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def clean_query_stats(before: nil)
end

def slow_queries(query_stats: nil, **options)
query_stats ||= self.query_stats(options)
query_stats ||= self.query_stats(**options)
query_stats.select { |q| q[:calls].to_i >= slow_query_calls.to_i && q[:average_time].to_f >= slow_query_ms.to_f }
end

Expand Down

0 comments on commit 488972a

Please sign in to comment.