Skip to content

Commit 06c8de0

Browse files
fix: Format gat commands (#1312)
* fix: Format gat commands * fix: skip test unless it implements gat Co-authored-by: Francis Bogsanyi <[email protected]> --------- Co-authored-by: Francis Bogsanyi <[email protected]>
1 parent 00d379c commit 06c8de0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ module Utils
4141
'multi_add' => 'addq',
4242
'multi_replace' => 'replaceq',
4343
'multi_delete' => 'deleteq',
44-
'touch' => 'touch'
44+
'touch' => 'touch',
45+
'gat' => 'gat'
4546
# 'sasl_authentication' => 'auth_negotiation',
4647
# 'sasl_authentication' => 'auth_request',
4748
}.freeze

instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@
127127
_(span.name).must_equal 'set'
128128
_(span.attributes['db.statement']).must_equal 'set ?'
129129
end
130+
131+
it 'supports gat' do
132+
skip unless dalli.respond_to?(:gat)
133+
134+
dalli.gat('foo')
135+
136+
_(exporter.finished_spans.size).must_equal 1
137+
_(span.name).must_equal 'gat'
138+
_(span.attributes['db.statement']).must_equal 'gat foo 0'
139+
end
130140
end
131141

132142
# Dalli 3.x has different behavior than 2.x versions and attempts to retry on network errors

0 commit comments

Comments
 (0)