Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/lib/peek
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/lib/peek')
-rw-r--r--spec/lib/peek/views/redis_detailed_spec.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/lib/peek/views/redis_detailed_spec.rb b/spec/lib/peek/views/redis_detailed_spec.rb
index a757af50dcb..5d75a6522e4 100644
--- a/spec/lib/peek/views/redis_detailed_spec.rb
+++ b/spec/lib/peek/views/redis_detailed_spec.rb
@@ -7,17 +7,19 @@ RSpec.describe Peek::Views::RedisDetailed, :request_store do
using RSpec::Parameterized::TableSyntax
- where(:cmd, :expected) do
- [:auth, 'test'] | 'auth <redacted>'
- [:set, 'key', 'value'] | 'set key <redacted>'
- [:set, 'bad'] | 'set bad'
- [:hmset, 'key1', 'value1', 'key2', 'value2'] | 'hmset key1 <redacted>'
- [:get, 'key'] | 'get key'
+ where(:commands, :expected) do
+ [[:auth, 'test']] | 'auth <redacted>'
+ [[:set, 'key', 'value']] | 'set key <redacted>'
+ [[:set, 'bad']] | 'set bad'
+ [[:hmset, 'key1', 'value1', 'key2', 'value2']] | 'hmset key1 <redacted>'
+ [[:get, 'key']] | 'get key'
+ [[:get, 'key1'], [:get, 'key2']] | 'get key1, get key2'
+ [[:set, 'key1', 'value'], [:set, 'key2', 'value']] | 'set key1 <redacted>, set key2 <redacted>'
end
with_them do
it 'scrubs Redis commands' do
- Gitlab::Instrumentation::Redis::SharedState.detail_store << { cmd: cmd, duration: 1.second }
+ Gitlab::Instrumentation::Redis::SharedState.detail_store << { commands: commands, duration: 1.second }
expect(subject.results[:details].count).to eq(1)
expect(subject.results[:details].first)
@@ -29,9 +31,9 @@ RSpec.describe Peek::Views::RedisDetailed, :request_store do
end
it 'returns aggregated results' do
- Gitlab::Instrumentation::Redis::Cache.detail_store << { cmd: [:get, 'test'], duration: 0.001 }
- Gitlab::Instrumentation::Redis::Cache.detail_store << { cmd: [:get, 'test'], duration: 1.second }
- Gitlab::Instrumentation::Redis::SharedState.detail_store << { cmd: [:get, 'test'], duration: 1.second }
+ Gitlab::Instrumentation::Redis::Cache.detail_store << { commands: [[:get, 'test']], duration: 0.001 }
+ Gitlab::Instrumentation::Redis::Cache.detail_store << { commands: [[:get, 'test']], duration: 1.second }
+ Gitlab::Instrumentation::Redis::SharedState.detail_store << { commands: [[:get, 'test']], duration: 1.second }
expect(subject.results[:calls]).to eq(3)
expect(subject.results[:duration]).to eq('2001.00ms')