Sha256: 38d9b9f63c8bfd7004671b1379f15eb4c7eac8dc36cb50ce5a0d2010609bc15d

Contents?: true

Size: 428 Bytes

Versions: 8

Compression:

Stored size: 428 Bytes

Contents

module RailsPerformance
  module Reports
    class RecentRequestsReport < BaseReport
      TIME_WINDOW = 60.minutes

      def set_defaults
        @sort ||= :datetimei
      end

      def data
        time_agoi = TIME_WINDOW.ago.to_i
        db.data
          .collect{|e| e.record_hash}
          .select{|e| e if e[sort] >= time_agoi}
          .sort{|a, b| b[sort] <=> a[sort]}
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_performance-1.0.2 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.1 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0.beta5 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0.beta4 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0.beta3 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0.beta2 lib/rails_performance/reports/recent_requests_report.rb
rails_performance-1.0.0.beta1 lib/rails_performance/reports/recent_requests_report.rb