Describe the bug
The result returned by the object idletime command is inconsistent
To reproduce
The result returned by the command is inconsistent with what is written in the documentation and comments; the command returns the time in seconds, and the documentation and comments say that it returns milliseconds, for example https://redis.io/commands/object-idletime
we can fix it by change the file named ‘object.c’ in line 1253 addReplyLongLong(c,estimateObjectIdleTime(o)/1000); ==》addReplyLongLong(c,estimateObjectIdleTime(o));
Expected behavior return millsecond
Comment From: sundb
Ping @itamarhaber, It looks like a documentation error, the comment in the code is second.
"IDLETIME <key>",
" Return the idle time of the <key>, that is the approximated number of",
" seconds elapsed since the last access to the key.",
Comment From: enjoy-binbin
yes looks like it was introduced in https://github.com/redis/redis-doc/pull/1675/files#diff-d2ba73107a97884e556f67bb6023cc7c47fdc3478fa759fcc9f7b684e36e3ff3L16
`OBJECT IDLETIME <key>` returns the number of seconds since the object stored
at the specified key is idle (not requested by read or write operations).
While the value is returned in seconds the actual resolution of this timer is
10 seconds, but may vary in future implementations. This subcommand is
available when `maxmemory-policy` is set to an LRU policy or `noeviction`
and `maxmemory` is set.
@631086083 maybe you can make a quick fix in redis-doc: https://github.com/redis/redis-doc
Comment From: 631086083
yes looks like it was introduced in https://github.com/redis/redis-doc/pull/1675/files#diff-d2ba73107a97884e556f67bb6023cc7c47fdc3478fa759fcc9f7b684e36e3ff3L16
`OBJECT IDLETIME <key>` returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations). While the value is returned in seconds the actual resolution of this timer is 10 seconds, but may vary in future implementations. This subcommand is available when `maxmemory-policy` is set to an LRU policy or `noeviction` and `maxmemory` is set.@631086083 maybe you can make a quick fix in redis-doc: https://github.com/redis/redis-doc
Yes, the help subcommand in the source code also returns a second-level idletime, which should be due to inaccurate documentation. Thanks,I‘ll make a issue in redis-doc.