Получить полную последнюю команду клиента (включая ключ) от Redis

331
Jeremiah

Список клиентов Redis выдаст вам последнюю команду, выданную клиентом. Он не дает вам ключ, на котором была введена последняя команда. Я хотел бы получить список ключей, над которыми работает клиент BLPOP.

Есть ли способ получить это?

0

1 ответ на вопрос

1
Itamar Haber

Although it would be nice to have that kind introspective functionality, it does not exist in Redis ATM. Instead you can try catching the command in-flight to understand what your client is doing.

The straightforward manner to do that is running MONITOR (from a different connection) before the client issues the BLPOP command to get that information. Note that MONITOR carries a performance impact so you should refrain from doing it in production.

Я боялся этого. Благодарю за ваш ответ! Я также рассматриваю возможность добавления сообщения pub / sub вдоль команды push для улучшения регистрации / мониторинга. Jeremiah 8 лет назад 0