diff --git a/Makefile b/Makefile index cf442360..8171b41f 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ test: TEST_REDIS_URI="redis://localhost:16385" \ TEST_REDIS5_URI="redis://localhost:16383" \ TEST_REDIS6_URI="redis://localhost:16379" \ - TEST_REDIS74_URI="redis://localhost:16385" \ TEST_VALKEY7_URI="redis://localhost:16384" \ TEST_VALKEY8_URI="redis://localhost:16382" \ TEST_REDIS_2_8_URI="redis://localhost:16381" \ diff --git a/docker-compose.yml b/docker-compose.yml index 2989f4e5..493c9b66 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,62 +2,62 @@ services: redis74: image: redis:7.4 - command: "redis-server --enable-debug-command yes --protected-mode no --dbfilename dump74.rdb" + command: "redis-server --enable-debug-command yes --protected-mode no" ports: - "16385:6379" - "6379:6379" valkey8: image: valkey/valkey:8 - command: "redis-server --enable-debug-command yes --protected-mode no --dbfilename dump7.rdb" + command: "valkey-server --enable-debug-command yes --protected-mode no" ports: - "16382:6379" valkey7: image: valkey/valkey:7.2 - command: "redis-server --enable-debug-command yes --protected-mode no --dbfilename dump7.rdb" + command: "valkey-server --enable-debug-command yes --protected-mode no" ports: - "16384:6379" redis6: image: redis:6.2 - command: "redis-server --protected-mode no --dbfilename dump6.rdb" + command: "redis-server --protected-mode no" ports: - "16379:6379" redis5: image: redis:5 - command: "redis-server --dbfilename dump5.rdb" + command: "redis-server" ports: - "16383:6379" pwd-redis5: image: redis:5 - command: "redis-server --requirepass redis-password --dbfilename dump5-pwd.rdb" + command: "redis-server --requirepass redis-password" ports: - "16380:6379" pwd-redis6: image: redis:6 - command: "redis-server --requirepass dummy --user exporter on +CLIENT +INFO +SELECT +SLOWLOG +LATENCY '>exporter-password' --dbfilename dump6-pwd.rdb" + command: "redis-server --requirepass dummy --user exporter on +CLIENT +INFO +SELECT +SLOWLOG +LATENCY '>exporter-password'" ports: - "16390:6379" redis-2-8: image: redis:2.8 - command: "redis-server --dbfilename dump2-8.rdb" + command: "redis-server" ports: - "16381:6379" keydb-01: image: "eqalpha/keydb:x86_64_v6.3.1" - command: "keydb-server --protected-mode no --dbfilename dump-keydb-01.rdb" + command: "keydb-server --protected-mode no" ports: - "16401:6379" keydb-02: image: "eqalpha/keydb:x86_64_v6.3.1" - command: "keydb-server --protected-mode no --active-replica yes --replicaof keydb-01 6379 --dbfilename dump-keydb-02.rdb" + command: "keydb-server --protected-mode no --active-replica yes --replicaof keydb-01 6379" ports: - "16402:6379" diff --git a/exporter/clients_test.go b/exporter/clients_test.go index 0a2fd3e0..e85ce671 100644 --- a/exporter/clients_test.go +++ b/exporter/clients_test.go @@ -1,7 +1,6 @@ package exporter import ( - "os" "strings" "testing" "time" @@ -159,29 +158,20 @@ func TestExportClientList(t *testing.T) { in string found bool }{ - { - in: "connected_client_info", - }, { - in: "connected_client_output_buffer_memory_usage_bytes", - }, { - in: "connected_client_total_memory_consumed_bytes", - }, { - in: "connected_client_created_at_timestamp", - }, { - in: "connected_client_idle_since_timestamp", - }, { - in: "connected_client_channel_subscriptions_count", - }, { - in: "connected_client_pattern_matching_subscriptions_count", - }, { - in: "connected_client_query_buffer_length_bytes", - }, { - in: "connected_client_query_buffer_free_space_bytes", - }, { - in: "connected_client_output_buffer_length_bytes", - }, { - in: "connected_client_output_list_length", - }, + {in: "connected_client_info"}, + {in: "connected_client_output_buffer_memory_usage_bytes"}, + {in: "connected_client_total_memory_consumed_bytes"}, + {in: "connected_client_created_at_timestamp"}, + {in: "connected_client_idle_since_timestamp"}, + {in: "connected_client_channel_subscriptions_count"}, + {in: "connected_client_pattern_matching_subscriptions_count"}, + {in: "connected_client_query_buffer_length_bytes"}, + {in: "connected_client_query_buffer_free_space_bytes"}, + {in: "connected_client_output_buffer_length_bytes"}, + {in: "connected_client_output_list_length"}, + {in: "connected_client_shard_channel_subscriptions_count"}, + {in: "connected_client_shard_channel_watched_keys"}, + {in: "connected_client_info"}, } for m := range chM { desc := m.Desc().String() @@ -233,73 +223,3 @@ func TestExportClientListInclPort(t *testing.T) { } } } - -func TestExportClientListRedis7(t *testing.T) { - redisSevenAddr := os.Getenv("TEST_REDIS74_URI") - if redisSevenAddr == "" { - t.Skipf("Skipping TestExportClientListRedis7, missing env var TEST_REDIS74_URI") - } - e := getTestExporterWithAddrAndOptions(redisSevenAddr, Options{ - Namespace: "test", Registry: prometheus.NewRegistry(), - ExportClientList: true, - }) - - chM := make(chan prometheus.Metric) - go func() { - e.Collect(chM) - close(chM) - }() - - tsts := []struct { - in string - found bool - }{ - { - in: "connected_client_shard_channel_subscriptions_count", - }, { - in: "connected_client_shard_channel_watched_keys", - }, - } - for m := range chM { - desc := m.Desc().String() - for i := range tsts { - if strings.Contains(desc, tsts[i].in) { - tsts[i].found = true - } - } - } - - for _, tst := range tsts { - if !tst.found { - t.Errorf(`%s was *not* found in isExportClientList metrics but expected`, tst.in) - } - } -} - -func TestExportClientListResp(t *testing.T) { - redisSevenAddr := os.Getenv("TEST_VALKEY7_URI") - e := getTestExporterWithAddrAndOptions(redisSevenAddr, Options{ - Namespace: "test", Registry: prometheus.NewRegistry(), - ExportClientList: true, - }) - - chM := make(chan prometheus.Metric) - go func() { - e.Collect(chM) - close(chM) - }() - - found := false - for m := range chM { - desc := m.Desc().String() - if strings.Contains(desc, "connected_client_info") { - if strings.Contains(desc, "resp") { - found = true - } - } - } - - if !found { - t.Errorf(`connected_client_info did *not* include "resp" in isExportClientList metrics but was expected`) - } -}