Commit e952adee authored by alinamihaila's avatar alinamihaila

Add CountBoardsMetric

parent cfdd2aca
---
key_path: counts.boards
description: Count of total Boards created
description: Count of Boards created
product_section: dev
product_stage: plan
product_group: group::project management
product_category: boards
product_category: boards
value_type: number
status: data_available
time_frame: all
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountBoardsMetric'
distribution:
- ce
- ee
- ee
tier:
- free
- premium
- ultimate
- premium
- ultimate
......@@ -468,7 +468,7 @@ Tiers: `free`
### `counts.boards`
Count of total Boards created
Count of Boards created
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216181252_boards.yml)
......
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class CountBoardsMetric < DatabaseMetric
operation :count
relation { Board }
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::CountBoardsMetric do
let_it_be(:board) { create(:board) }
it_behaves_like 'a correct instrumented metric value', { time_frame: 'all', data_source: 'database' }, 1
end
......@@ -20,6 +20,10 @@ RSpec.describe Gitlab::UsageDataMetrics do
it 'includes top level keys' do
expect(subject).to include(:uuid)
end
it 'includes counts keys' do
expect(subject[:counts]).to include(:boards)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment