nkrode / RedisLive

Visualize your redis instances, analyze query patterns and spikes.

Home Page:http://www.nkrode.com/article/real-time-dashboard-for-redis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File "./redis-monitor.py", line 206, in run

MyselfWarmHome opened this issue · comments

commented

Traceback (most recent call last):

File "./redis-monitor.py", line 206, in run
used_memory, peak_memory)
File "/home/omsadmin/redis-monitor/nkrode-RedisLive-e1d7763/src/dataprovider/redisprovider.py", line 30, in save_memory_info
self.conn.zadd(server + ":memory", str(timeutils.convert_to_epoch(timestamp)), data)
File "/usr/local/python/lib/python2.7/site-packages/redis/client.py", line 2263, in zadd
for pair in iteritems(mapping):
File "/usr/local/python/lib/python2.7/site-packages/redis/_compat.py", line 94, in iteritems
return x.iteritems()
AttributeError: 'str' object has no attribute 'iteritems'

@MyselfWarmHome Have you solved it?

@MyselfWarmHome, @nonomal
Revert the latest version of redis lib to a 2.. (e.g. 2.10.6). The API has changed: https://pypi.org/project/redis/#description

The proper fix would be changing the code, but I don't want to touch this old version of Python...

@greatvovan “Revert the latest version of redis lib to a 2.. (e.g. 2.10.6)”
I don't quite understand, is the version of Redis that I upgraded?

I used redis3.2.6, you said that the 2.10.6 version made me doubt, my python is 2.7.15 (I just thought that there is a problem with the default 2.7.5 version), so I hope to get the answer.

@nonomal I did not say that the 2.10.6 version made you doubt.

I am saying, if you are experiencing the same problem as in the one in the first post, it is due to Redis library version (it is called redis and specified without version in the requirements.txt file). Since the version 3.*.* they changed API, which causes the problem. It has nothing to do with your Python version.

@greatvovan
Thank you very much, I use the command:
Pip uninstall redis
Pip install -v redis==2.10.6
Successfully solved this problem, thank you

I hope I can contact the redislive author to coordinate the problem. Is there any plan for this?

I have the same problem.Here is my solution.
Open the file

redisprovider.py

in the directory of

.../src/dataprovider

, around line 30 is the code

self.conn.zadd(server + ":memory", str(timeutils.convert_to_epoch(timestamp)), data)

. Try to remove the second paramter

str(timeutils.convert_to_epoch(timestamp))

, and leave the code like

self.conn.zadd(server + ":memory", data)

. Then the problem has gone.