【发布时间】:2018-06-12 15:52:49
【问题描述】:
以下来自https://redis.io/commands/info的文档
我想从返回的bulk string 中获取特定的键/值
例如:
# Rails Controller Code
redis = Redis.new(host: 'localhost', port: 6379)
render json: redis.INFO
... returns ....
# Server
redis_version:999.999.999
redis_git_sha1:3c968ff0
redis_git_dirty:0
......
......
# Memory
used_memory:167560008
used_memory_human:159.80M
used_memory_rss:174358528
used_memory_rss_human:166.28M
.....
我只想获得 used_memory 等等。
是否可以不使用 Ruby 调整?
ALSO如果我已经在控制器中初始化了 Redis,如何使用 MEMORY DOCTOR 获取信息? (例如redis = Redis.new(host: 'localhost', port: 6379))
https://redis.io/commands/memory-doctor
提前致谢!
【问题讨论】:
标签: ruby-on-rails redis