Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-05-09 07:15:36 +0300
committerRegis <boudinot.regis@yahoo.com>2017-05-10 02:19:42 +0300
commit1ba06c8c4b7b8dc4db509adddbaddf34cd80eacc (patch)
tree5a90650d70161bf20764e6be85240c1499fc083c /lib
parent379c90834c4f64245985268cdec3d35c84a00117 (diff)
Merge branch 'mr-widget-redesign-review' into 'master'
Merge request widget redesign Closes #25424 and #27950 See merge request !10319
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/prometheus.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/prometheus.rb b/lib/gitlab/prometheus.rb
index 8827507955d..37125980b1c 100644
--- a/lib/gitlab/prometheus.rb
+++ b/lib/gitlab/prometheus.rb
@@ -13,18 +13,18 @@ module Gitlab
json_api_get('query', query: '1')
end
- def query(query)
+ def query(query, time: Time.now)
get_result('vector') do
- json_api_get('query', query: query)
+ json_api_get('query', query: query, time: time.utc.to_f)
end
end
- def query_range(query, start: 8.hours.ago)
+ def query_range(query, start: 8.hours.ago, stop: Time.now)
get_result('matrix') do
json_api_get('query_range',
query: query,
start: start.to_f,
- end: Time.now.utc.to_f,
+ end: stop.to_f,
step: 1.minute.to_i)
end
end