debian-mirror-gitlab/app/controllers/projects/environments/sample_metrics_controller.rb

14 lines
415 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
class Projects::Environments::SampleMetricsController < Projects::ApplicationController
def query
2020-03-09 13:42:32 +05:30
result = Metrics::SampleMetricsService.new(params[:identifier], range_start: params[:start], range_end: params[:end]).query
2020-01-01 13:55:28 +05:30
if result
render json: { "status": "success", "data": { "resultType": "matrix", "result": result } }
else
render_404
end
end
end