Class: Gitlab::Metrics::Dashboard::Stages::GrafanaFormatter

Inherits:
BaseStage
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/metrics/dashboard/stages/grafana_formatter.rb

Constant Summary collapse

CHART_TYPE =
'area-chart'
PROXY_PATH =
'api/v1/query_range'

Constants included from Defaults

Defaults::DEFAULT_PANEL_TYPE

Instance Attribute Summary

Attributes inherited from BaseStage

#dashboard, #params, #project

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from BaseStage

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Metrics::Dashboard::Stages::BaseStage

Instance Method Details

#transform!Object

Reformats the specified panel in the Gitlab dashboard-yml format


15
16
17
18
19
20
21
22
# File 'lib/gitlab/metrics/dashboard/stages/grafana_formatter.rb', line 15

def transform!
  validate_input!

  new_dashboard = formatted_dashboard

  dashboard.clear
  dashboard.merge!(new_dashboard)
end