Analytics::Throughput

Public Instance Methods

average_response_graph() click to toggle source

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 50
def average_response_graph
  app_id = params[:app_id]
  time_array = get_start_end_time(params[:date], params[:start_time], params[:end_time])    
  if time_array.size > 1
    avg_res_time_graph = plot_graph("graph/get_average_response_data/#{app_id}?time_slab=#{time_array[0]}.#{time_array[1]}", 'server_memory_usage')
    render :text => avg_res_time_graph 
  else
    render :text => time_array[0]
  end
end
get_average_response_data() click to toggle source

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 63
def get_average_response_data
  app_id = params[:id]
  start_time, end_time = get_time_range(params[:time_slab])
  wall_time, response_time, max, slab, step = AppTimeSample.get_application_data(app_id, start_time, end_time, "averageresponsetime")
  line_graph(wall_time, response_time, AVERAGE_RESPONSE_TIME_GRAPH_TITLE, max, slab, step, "Wall Time","Time (in ms)")
end
get_peak_requests_data() click to toggle source

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 84
def get_peak_requests_data
  app_id = params[:id]
  start_time, end_time = get_time_range(params[:time_slab])
  wall_time, throughput, max, slab, step = AppTimeSample.get_application_data(app_id, start_time, end_time, "throughput")
  line_graph(wall_time, throughput, REQUEST_PER_SECOND_GRAPH_TITLE, max, slab, step,"Wall Time","Req/sec")
end
get_throughput_data(app_id) click to toggle source

This method renders the partial containing throughput Graphs for an application.

# File lib/graph_controller_extensions/throughput_analytics.rb, line 35
def get_throughput_data(app_id)
  @app_id = app_id
  check_and_set_query_date
  start_date = session[:start_time].strftime("%Y-%m-%d")+" 00:00:00"
  end_date = session[:start_time].strftime("%Y-%m-%d")+" 23:59:59"
  urls = UrlTimeSample.get_urls(start_date, end_date, app_id)
  if urls.size > 0        
    @avg_res_time_graph, @app_throughput_graph = get_throughput_graph(@app_id)
  else
    flash[:notice] = NO_DATA_FOUND
  end      
  render :partial => 'throughput_graph'
end
get_throughput_graph(app_id) click to toggle source

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
def get_throughput_graph(app_id)
  @start_hour, @end_hour, start_time, end_time = get_start_and_end_time_from_session()      
  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
  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
  return avg_res_time_graph, app_throughput_graph
end
peak_requests_graph() click to toggle source

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 71
def peak_requests_graph
  app_id = params[:app_id]
  time_array = get_start_end_time(params[:date], params[:start_time], params[:end_time])    
  if time_array.size > 1
    app_throughput_graph = plot_graph("graph/get_peak_requests_data/#{app_id}?time_slab=#{time_array[0]}.#{time_array[1]}", 'throughput')
    render :text => app_throughput_graph 
  else
    render :text => time_array[0]
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.