diff options
author | syasonik <syasonik@gitlab.com> | 2019-02-15 19:36:59 +0800 |
---|---|---|
committer | syasonik <syasonik@gitlab.com> | 2019-02-15 19:47:30 +0800 |
commit | 2ddc8aa51cdc9fe9f36e024347f7bdc43c9e59ac (patch) | |
tree | 26458bde01705129bc8e7e972a8f479a30658ad6 /app | |
parent | 44542b4505d5b0a8d14e2d1aaec369703860b51c (diff) | |
download | gitlab-ce-import-multiple-queries.tar.gz |
Migrate queries and support importing to tableimport-multiple-queries
Diffstat (limited to 'app')
-rw-r--r-- | app/models/prometheus_metric.rb | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/app/models/prometheus_metric.rb b/app/models/prometheus_metric.rb index 22b64744fe7..3cbaa870b1d 100644 --- a/app/models/prometheus_metric.rb +++ b/app/models/prometheus_metric.rb @@ -95,28 +95,7 @@ class PrometheusMetric < ActiveRecord::Base end def queries - [ - { - query_range: query, - unit: unit, - label: legend, - series: query_series - }.compact - ] - end - - def query_series - case legend - when 'Status Code' - [{ - label: 'status_code', - when: [ - { value: '2xx', color: 'green' }, - { value: '4xx', color: 'orange' }, - { value: '5xx', color: 'red' } - ] - }] - end + prometheus_queries.map(&:to_query_hash) end private |