summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-04-03 10:53:42 +0200
committerPeter Leitzen <pleitzen@gitlab.com>2019-04-04 15:31:08 +0200
commitcdc70f3678ada1dc39e35e61b490e21d483fe7b1 (patch)
tree65245d2fee9fd92cede8ba4009f02c815a4ef876
parentbd2660bd43021025c3e1d0f70c0a7e1847ef3562 (diff)
downloadgitlab-ce-58839-automatically-set-prometheus-step-interval.tar.gz
Tweak calling site of `prometheus_query_range_url`58839-automatically-set-prometheus-step-interval
-rw-r--r--spec/support/helpers/prometheus_helpers.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/helpers/prometheus_helpers.rb b/spec/support/helpers/prometheus_helpers.rb
index eec2783ce03..08d1d7a6059 100644
--- a/spec/support/helpers/prometheus_helpers.rb
+++ b/spec/support/helpers/prometheus_helpers.rb
@@ -26,12 +26,14 @@ module PrometheusHelpers
end
def prometheus_query_range_url(prometheus_query, start: 8.hours.ago, stop: Time.now, step: nil)
+ start = start.to_f
+ stop = stop.to_f
step ||= Gitlab::PrometheusClient.compute_step(start, stop)
query = {
query: prometheus_query,
- start: start.to_f,
- end: stop.to_f,
+ start: start,
+ end: stop,
step: step
}.to_query