summaryrefslogtreecommitdiff
path: root/lib/gitlab/prometheus/metric.rb
blob: 7ebfc2e25a953a2891b5a24d57d2e0371e031901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Gitlab
  module Prometheus
    class Metric
      include ActiveModel::Model

      attr_accessor :id, :title, :required_metrics, :weight, :y_label, :queries

      validates :title, :required_metrics, :weight, :y_label, :queries, presence: true

      def initialize(params = {})
        super(params)
        @y_label ||= 'Values'
      end
    end
  end
end