Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 402d78a9 authored by Simon Delamare's avatar Simon Delamare
Browse files

[lib] wiki/kwollect: mark a metric optional if it is optinal on any cluster

parent 586eff8a
No related branches found
No related tags found
1 merge request!399[lib] wiki/kwollect: mark a metric optional if it is optinal on any cluster
Pipeline #611252 passed
...@@ -23,7 +23,7 @@ class KwollectMetricsGenerator < WikiGenerator ...@@ -23,7 +23,7 @@ class KwollectMetricsGenerator < WikiGenerator
metric_names.sort.each do |metric_name| metric_names.sort.each do |metric_name|
optional = all_metrics.select{|m| m["name"] == metric_name}.first["period"] == 0 ? "*" : "" optional = all_metrics.select{|m| m["name"] == metric_name}.any?{|metric| metric["period"] == 0} ? "*" : ""
descriptions = all_metrics.select{|m| m["name"] == metric_name}.map{|metric| metric["description"]}.uniq descriptions = all_metrics.select{|m| m["name"] == metric_name}.map{|metric| metric["description"]}.uniq
if descriptions.length != 1 if descriptions.length != 1
description = longest_common_prefix(descriptions) + "XXX" + longest_common_suffix(descriptions) description = longest_common_prefix(descriptions) + "XXX" + longest_common_suffix(descriptions)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment