Commit 1f3f6049 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Mayra Cabrera

Usage ping non sql metrics

parent d18efebe
# frozen_string_literal: true
module Gitlab
class UsageDataNonSqlMetrics < UsageData
SQL_METRIC_DEFAULT = -3
class << self
def count(relation, column = nil, batch: true, batch_size: nil, start: nil, finish: nil)
SQL_METRIC_DEFAULT
end
def distinct_count(relation, column = nil, batch: true, batch_size: nil, start: nil, finish: nil)
SQL_METRIC_DEFAULT
end
def estimate_batch_distinct_count(relation, column = nil, batch_size: nil, start: nil, finish: nil)
SQL_METRIC_DEFAULT
end
def sum(relation, column, batch_size: nil, start: nil, finish: nil)
SQL_METRIC_DEFAULT
end
def histogram(relation, column, buckets:, bucket_size: buckets.size)
SQL_METRIC_DEFAULT
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::UsageDataNonSqlMetrics do
let(:default_count) { Gitlab::UsageDataNonSqlMetrics::SQL_METRIC_DEFAULT }
describe '.count' do
it 'returns default value for count' do
expect(described_class.count(User)).to eq(default_count)
end
end
describe '.distinct_count' do
it 'returns default value for distinct count' do
expect(described_class.distinct_count(User)).to eq(default_count)
end
end
describe '.estimate_batch_distinct_count' do
it 'returns default value for estimate_batch_distinct_count' do
expect(described_class.estimate_batch_distinct_count(User)).to eq(default_count)
end
end
describe '.sum' do
it 'returns default value for sum' do
expect(described_class.sum(JiraImportState.finished, :imported_issues_count)).to eq(default_count)
end
end
describe '.histogram' do
it 'returns default value for histogram' do
expect(described_class.histogram(JiraImportState.finished, :imported_issues_count, buckets: [], bucket_size: 0)).to eq(default_count)
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