debian-mirror-gitlab/app/controllers/projects/environments/sample_metrics_controller.rb
2021-01-30 21:13:32 +05:30

15 lines
444 B
Ruby

# frozen_string_literal: true
class Projects::Environments::SampleMetricsController < Projects::ApplicationController
feature_category :metrics
def query
result = Metrics::SampleMetricsService.new(params[:identifier], range_start: params[:start], range_end: params[:end]).query
if result
render json: { "status": "success", "data": { "resultType": "matrix", "result": result } }
else
render_404
end
end
end