Class: RailsMetricsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RailsMetricsController
- Defined in:
- app/controllers/rails_metrics_controller.rb
Instance Method Summary collapse
-
#all ⇒ Object
GET /rails_metrics.
-
#chart ⇒ Object
GET /rails_metrics/1/chart.
-
#destroy ⇒ Object
DELETE /rails_metrics/1.
-
#destroy_all ⇒ Object
DELETE /rails_metrics/destroy_all.
-
#index ⇒ Object
GET /rails_metrics.
-
#show ⇒ Object
GET /rails_metrics/1.
Instance Method Details
#all ⇒ Object
GET /rails_metrics
20 21 22 23 24 25 |
# File 'app/controllers/rails_metrics_controller.rb', line 20 def all @metrics = all_scopes(RailsMetrics.store) @metrics_count = @metrics.count @metrics = with_pagination(@metrics) respond_with(@metrics) end |
#chart ⇒ Object
GET /rails_metrics/1/chart
13 14 15 16 17 |
# File 'app/controllers/rails_metrics_controller.rb', line 13 def chart @metrics = RailsMetrics.store.earliest.by_request_id(params[:id]).all @request = RailsMetrics.store.mount_tree(@metrics.reverse) respond_with(@metrics) end |
#destroy ⇒ Object
DELETE /rails_metrics/1
34 35 36 37 38 39 |
# File 'app/controllers/rails_metrics_controller.rb', line 34 def destroy @metric = find_store(params[:id]) @metric.destroy flash[:notice] = "Metric ##{@metric.id} was deleted with success." respond_with(@metric, :location => rails_metrics_path) end |
#destroy_all ⇒ Object
DELETE /rails_metrics/destroy_all
42 43 44 45 46 |
# File 'app/controllers/rails_metrics_controller.rb', line 42 def destroy_all count = all_scopes(RailsMetrics.store).delete_all flash[:notice] = "All #{count} selected metrics were deleted." redirect_to rails_metrics_path end |
#index ⇒ Object
GET /rails_metrics
5 6 7 8 9 10 |
# File 'app/controllers/rails_metrics_controller.rb', line 5 def index @metrics = order_scopes(RailsMetrics.store.requests) @metrics_count = @metrics.count @metrics = with_pagination(@metrics) respond_with(@metrics) end |
#show ⇒ Object
GET /rails_metrics/1
28 29 30 31 |
# File 'app/controllers/rails_metrics_controller.rb', line 28 def show @metric = find_store(params[:id]) respond_with(@metric) end |