lib/pghero/methods/query_stats.rb in pghero-2.4.1 vs lib/pghero/methods/query_stats.rb in pghero-2.4.2
- old
+ new
@@ -1,9 +1,9 @@
module PgHero
module Methods
module QueryStats
def query_stats(historical: false, start_at: nil, end_at: nil, min_average_time: nil, min_calls: nil, **options)
- current_query_stats = historical && end_at && end_at < Time.now ? [] : current_query_stats(options)
+ current_query_stats = historical && end_at && end_at < Time.now ? [] : current_query_stats(**options)
historical_query_stats = historical && historical_query_stats_enabled? ? historical_query_stats(start_at: start_at, end_at: end_at, **options) : []
query_stats = combine_query_stats((current_query_stats + historical_query_stats).group_by { |q| [q[:query_hash], q[:user]] })
query_stats = combine_query_stats(query_stats.group_by { |q| [normalize_query(q[:query]), q[:user]] })