Module | Analytics::Throughput |
In: |
lib/graph_controller_extensions/throughput_analytics.rb
|
This method is called for getting the an applications average response graph for a specific date and time.
# File lib/graph_controller_extensions/throughput_analytics.rb, line 43 43: def average_response_graph 44: app_id = params[:app_id] 45: time_array = get_start_end_time(params[:date], params[:start_time], params[:end_time]) 46: if time_array.size > 1 47: avg_res_time_graph = plot_graph("graph/get_average_response_data/#{app_id}?time_slab=#{time_array[0]}.#{time_array[1]}", 'server_memory_usage') 48: render :text => avg_res_time_graph 49: else 50: render :text => time_array[0] 51: end 52: end
This method is used to get the data for average respose for a specific application from the AppTimeSample model. This data is supplied to the line graph method to plot the line graph.
# File lib/graph_controller_extensions/throughput_analytics.rb, line 56 56: def get_average_response_data 57: app_id = params[:id] 58: start_time, end_time = get_time_range(params[:time_slab]) 59: wall_time, response_time, max, slab, step = AppTimeSample.get_application_data(app_id, start_time, end_time, "averageresponsetime") 60: line_graph(wall_time, response_time, AVERAGE_RESPONSE_TIME_GRAPH_TITLE, max, slab, step, "Wall Time","Time (in ms)") 61: end
This method is used to get the data for throughput for a specific application from the AppTimeSample model. This data is supplied to the line graph method to plot the line graph.
# File lib/graph_controller_extensions/throughput_analytics.rb, line 77 77: def get_peak_requests_data 78: app_id = params[:id] 79: start_time, end_time = get_time_range(params[:time_slab]) 80: wall_time, throughput, max, slab, step = AppTimeSample.get_application_data(app_id, start_time, end_time, "throughput") 81: line_graph(wall_time, throughput, REQUEST_PER_SECOND_GRAPH_TITLE, max, slab, step,"Wall Time","Req/sec") 82: end
This method renders the partial containing throughput Graphs for an application.
# File lib/graph_controller_extensions/throughput_analytics.rb, line 35 35: def get_throughput_data(app_id) 36: @app_id = app_id 37: check_and_set_query_date 38: @avg_res_time_graph, @app_throughput_graph = get_throughput_graph(@app_id) 39: render :partial => 'throughput_graph' 40: end
This method is to populate the varriable avg_res_time_graph and app_throughput_graph with the respective graphs data. avg_res_time_graph contains the data for average response time for an application. app_throughput_graph contains the data for throughput of an application .
# File lib/graph_controller_extensions/throughput_analytics.rb, line 27 27: def get_throughput_graph(app_id) 28: @start_hour, @end_hour, start_time, end_time = get_start_and_end_time_from_session() 29: avg_res_time_graph = plot_graph("graph/get_average_response_data/#{app_id}?time_slab=#{start_time}.#{end_time}",'average_response')#Graph depicts the average response time of application 30: app_throughput_graph = plot_graph("graph/get_peak_requests_data/#{app_id}?time_slab=#{start_time}.#{end_time}", 'throughput')# Graph is depicting the throughput for an application 31: return avg_res_time_graph, app_throughput_graph 32: end
This method is called for getting the an applications throughput graph for a specific date and time.
# File lib/graph_controller_extensions/throughput_analytics.rb, line 64 64: def peak_requests_graph 65: app_id = params[:app_id] 66: time_array = get_start_end_time(params[:date], params[:start_time], params[:end_time]) 67: if time_array.size > 1 68: app_throughput_graph = plot_graph("graph/get_peak_requests_data/#{app_id}?time_slab=#{time_array[0]}.#{time_array[1]}", 'throughput') 69: render :text => app_throughput_graph 70: else 71: render :text => time_array[0] 72: end 73: end