Sha256: 4b9573300e1d8a172846539a6a5457e34d33bedd3855f8b2692d5005a681cca0
Contents?: true
Size: 1.28 KB
Versions: 16
Compression:
Stored size: 1.28 KB
Contents
module Concen class PerformancesController < ApplicationController def show @page_title = "Performance" end def responses @stats = {} @stats[:total_runtime] = Response.where(:created_at.gte => Time.now - 1.hour).asc(:created_at).map do |response| [(response.created_at.utc.to_f + response.created_at.utc_offset)*1000, response.total_runtime] end @stats[:view_runtime] = Response.where(:created_at.gte => Time.now - 1.hour).asc(:created_at).map do |response| if response.respond_to?("view_runtime") [(response.created_at.utc.to_f + response.created_at.utc_offset)*1000, response.view_runtime] end end @stats[:mongo_runtime] = Response.where(:created_at.gte => Time.now - 1.hour).asc(:created_at).map do |response| if response.respond_to?("mongo_runtime") [(response.created_at.utc.to_f + response.created_at.utc_offset)*1000, response.mongo_runtime] end end respond_to do |format| format.json { render :json => @stats } end end def runtimes @runtimes_stats = Response.aggregate_average_runtime(:type => params[:type]) respond_to do |format| format.html { render :partial => "concen/performances/runtimes" } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems