2019-12-16 16:08:00 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Projects::Environments::SampleMetricsController < Projects::ApplicationController
|
2020-10-08 14:08:32 -04:00
|
|
|
feature_category :metrics
|
|
|
|
|
2019-12-16 16:08:00 -05:00
|
|
|
def query
|
2019-12-19 13:07:48 -05:00
|
|
|
result = Metrics::SampleMetricsService.new(params[:identifier], range_start: params[:start], range_end: params[:end]).query
|
2019-12-16 16:08:00 -05:00
|
|
|
|
|
|
|
if result
|
|
|
|
render json: { "status": "success", "data": { "resultType": "matrix", "result": result } }
|
|
|
|
else
|
|
|
|
render_404
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|