Class: Anomonitor::MetricsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Anomonitor::MetricsController
- Defined in:
- app/controllers/anomonitor/metrics_controller.rb
Instance Method Summary collapse
Instance Method Details
#export_json ⇒ Object
9 10 11 |
# File 'app/controllers/anomonitor/metrics_controller.rb', line 9 def export_json render json: MetricsExport.json_payload end |
#export_prometheus ⇒ Object
13 14 15 16 |
# File 'app/controllers/anomonitor/metrics_controller.rb', line 13 def export_prometheus render plain: MetricsExport.prometheus_text, content_type: "text/plain; version=0.0.4; charset=utf-8" end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/anomonitor/metrics_controller.rb', line 5 def index @metrics = MetricSample.recent(24).order(sampled_at: :desc).limit(200) end |