summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-01-07 13:38:42 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-01-07 13:38:42 +0000
commit61561a9eeb1dbb8273a1e8c8a5f37c0c01917c99 (patch)
treebac76bf31858c96c3a2c1264deaff8b2787eb75e /spec
parent9f268708df2c001d349c38ce8dd6b5643888d654 (diff)
parent7b10cb6f0f5758c17dd950587982ff400d7aa971 (diff)
downloadgitlab-ce-61561a9eeb1dbb8273a1e8c8a5f37c0c01917c99.tar.gz
Merge branch 'remove-more-influxdb-tags' into 'master'
See merge request !2328
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/metrics/rack_middleware_spec.rb6
-rw-r--r--spec/lib/gitlab/metrics/transaction_spec.rb15
2 files changed, 16 insertions, 5 deletions
diff --git a/spec/lib/gitlab/metrics/rack_middleware_spec.rb b/spec/lib/gitlab/metrics/rack_middleware_spec.rb
index a143fe4cfcd..4e6dfc73df2 100644
--- a/spec/lib/gitlab/metrics/rack_middleware_spec.rb
+++ b/spec/lib/gitlab/metrics/rack_middleware_spec.rb
@@ -40,9 +40,9 @@ describe Gitlab::Metrics::RackMiddleware do
expect(transaction).to be_an_instance_of(Gitlab::Metrics::Transaction)
end
- it 'tags the transaction with the request method and URI' do
- expect(transaction.tags[:request_method]).to eq('GET')
- expect(transaction.tags[:request_uri]).to eq('/foo')
+ it 'stores the request method and URI in the transaction as values' do
+ expect(transaction.values[:request_method]).to eq('GET')
+ expect(transaction.values[:request_uri]).to eq('/foo')
end
end
diff --git a/spec/lib/gitlab/metrics/transaction_spec.rb b/spec/lib/gitlab/metrics/transaction_spec.rb
index b9b94947afa..3a27f897735 100644
--- a/spec/lib/gitlab/metrics/transaction_spec.rb
+++ b/spec/lib/gitlab/metrics/transaction_spec.rb
@@ -30,9 +30,9 @@ describe Gitlab::Metrics::Transaction do
end
describe '#add_metric' do
- it 'adds a metric tagged with the transaction UUID' do
+ it 'adds a metric to the transaction' do
expect(Gitlab::Metrics::Metric).to receive(:new).
- with('rails_foo', { number: 10 }, { transaction_id: transaction.uuid })
+ with('rails_foo', { number: 10 }, {})
transaction.add_metric('foo', number: 10)
end
@@ -50,6 +50,17 @@ describe Gitlab::Metrics::Transaction do
end
end
+ describe '#set' do
+ it 'sets a value' do
+ transaction.set(:number, 10)
+
+ expect(transaction).to receive(:add_metric).
+ with('transactions', { duration: 0.0, number: 10 }, {})
+
+ transaction.track_self
+ end
+ end
+
describe '#add_tag' do
it 'adds a tag' do
transaction.add_tag(:foo, 'bar')