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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 15:10:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 15:10:25 +0300
commit999f47e9e6da399de9dc1de404f073f7dd30af0d (patch)
tree926bf806abb6705632dc19ceb75269f40a4c9fac /lib/gitlab/prometheus_client.rb
parent20bd3b7d4ebb1d7ebef305656b156313d09a6674 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/prometheus_client.rb')
-rw-r--r--lib/gitlab/prometheus_client.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/prometheus_client.rb b/lib/gitlab/prometheus_client.rb
index cf1abb3d2ec..e2a13610dc0 100644
--- a/lib/gitlab/prometheus_client.rb
+++ b/lib/gitlab/prometheus_client.rb
@@ -77,12 +77,12 @@ module Gitlab
# metric labels to their respective values.
#
# @return [Hash] mapping labels to their aggregate numeric values, or the empty hash if no results were found
- def aggregate(aggregate_query, time: Time.now)
+ def aggregate(aggregate_query, time: Time.now, transform_value: :to_f)
response = query(aggregate_query, time: time)
response.to_h do |result|
key = block_given? ? yield(result['metric']) : result['metric']
_timestamp, value = result['value']
- [key, value.to_i]
+ [key, value.public_send(transform_value)] # rubocop:disable GitlabSecurity/PublicSend
end
end