Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.45k stars 579 forks source link

[NEW] REDISCLI_AUTH for keydb-benchmark #359

Closed rnz closed 3 years ago

rnz commented 3 years ago

keydb-benchmark not use REDISCLI_AUTH for retrive password I think this feature is need for some scenarios, for example for Zabbix UserParameters:

UserParameter=redis.status[*],REDISCLI_AUTH=$(grep -Po '^requirepass\s\K.*' /etc/keydb/keydb.conf) keydb-cli -h $1 -p $2 info|grep $3|grep -v _human|cut -d : -f2
UserParameter=redis.latency[*],REDISCLI_AUTH=$(grep -Po '^requirepass\s\K.*' /etc/keydb/keydb.conf) keydb-cli -h $1 -p $2 --latency --raw -i 1 | cut -d' ' -f3
UserParameter=redis.bench[*],REDISCLI_AUTH=$(grep -Po '^requirepass\s\K.*' /etc/keydb/keydb.conf) keydb-benchmark -h $1 -p $2 -t ping -n 10000 -q|grep -i $3|tr ' ' '\n' | egrep -v '[a-z,A-Z]'
rnz commented 3 years ago

Also, unfortunately keydb-becnhmark output has changed and compatibility with previously created zabbix- templates is lost. 1) output have ASCII coloring by defaut - I think coloring must be disabled by default 2) output PING_MBULK instead PING_BULK - is it necessary to change this name?

VivekSainiEQ commented 3 years ago

Hi @rnz,

  1. You can add -a $REDISCLI_AUTH to the keydb-benchmark command to circumvent the fact that it doesn't read environment in variables.
  2. I don't think we should deviate from the default Redis behaviour for this matter.
  3. The output was changed to PING_MBULK to be consistent with the test name ping_mbulk, see https://github.com/redis/redis/pull/8109.