Commit a3bf2c99 authored by alinamihaila's avatar alinamihaila

Rename method to instrumentation

parent 5c4defb5
......@@ -16,7 +16,7 @@ module Gitlab
@options = options
end
def for_data_warehouse
def instrumentation
value
end
end
......
......@@ -59,7 +59,7 @@ module Gitlab
Gitlab::Usage::Metrics::Query.for(self.class.metric_operation, relation, self.class.column)
end
def for_data_warehouse
def instrumentation
to_sql
end
......
......@@ -6,7 +6,7 @@ module Gitlab
class << self
def add_metric(metric)
metric.for_data_warehouse
metric.instrumentation
end
def count(relation, column = nil, batch: true, batch_size: nil, start: nil, finish: nil)
......
......@@ -6,7 +6,7 @@ module Gitlab
class UsageDataQueries < UsageData
class << self
def add_metric(metric)
metric.for_data_warehouse
metric.instrumentation
end
def count(relation, column = nil, *args, **kwargs)
......
......@@ -6,7 +6,7 @@ RSpec.describe Gitlab::UsageDataNonSqlMetrics do
let(:default_count) { Gitlab::UsageDataNonSqlMetrics::SQL_METRIC_DEFAULT }
describe '#add_metric' do
let(:metric) { double(:metric, for_data_warehouse: 1) }
let(:metric) { double(:metric, instrumentation: 1) }
it 'computes the metric value for given metric' do
expect(described_class.add_metric(metric)).to eq(1)
......
......@@ -8,7 +8,7 @@ RSpec.describe Gitlab::UsageDataQueries do
end
describe '#add_metric' do
let(:metric) { double(:metric, for_data_warehouse: 'SELECT COUNT("users"."id") FROM "users"') }
let(:metric) { double(:metric, instrumentation: 'SELECT COUNT("users"."id") FROM "users"') }
it 'computes the metric value for given metric' do
expect(described_class.add_metric(metric)).to eq('SELECT COUNT("users"."id") FROM "users"')
......
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