Commit a3bf2c99 authored by alinamihaila's avatar alinamihaila

Rename method to instrumentation

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