summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics/dashboard/stages/track_panel_type.rb
blob: 71da779d16c037f7db355e9571991526418fa69d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Gitlab
  module Metrics
    module Dashboard
      module Stages
        class TrackPanelType < BaseStage
          def transform!
            for_panel_groups do |panel_group|
              for_panels_in(panel_group) do |panel|
                track_panel_type(panel)
              end
            end
          end

          private

          def track_panel_type(panel)
            panel_type = panel[:type]

            Gitlab::Tracking.event('MetricsDashboard::Chart', 'chart_rendered', label: panel_type)
          end
        end
      end
    end
  end
end