bwlewis / rredis

R client for Redis
http://illposed.net/
93 stars 25 forks source link

hyperloglog functionality support #30

Closed knight1128 closed 8 years ago

knight1128 commented 9 years ago

Hi~

Could you make hyperloglog redis command like pfcount command ?

knight1128 commented 9 years ago

I have tried 'redisCmd("PFCOUNT" ..)' function. It's well working!

bwlewis commented 9 years ago

Great. redisCmd comes in handy for new redis features. I'll leave this open and mark it as a new feature desired for next version...

knight1128 commented 9 years ago

Thank you @bwlewis !

The redisCmd("PFCOUNT") is taken 0.04s. I tried to call millions of redisCmd command, It takes 0.04 * number of milloins of the call.

So, could you make hyperloglog multiple-get function like mget?

bwlewis commented 8 years ago

There isn't a low-level redis mget for pfadd/pfcount/pfmerge, so I can't really add that (it doesn't exist).

However, I think you can achieve what your looking for with pipelining and/or transactions. Try using pipelining (aka non-blocking mode) and/or transactions. See:

?redisSetBlocking
?redisMulti
bwlewis commented 8 years ago

Sorry for the long latency, I finally got these functions into the package. You can try it out direct from GitHub with:

devtools::install_github("bwlewis/rredis")

See the redisPfadd, redisPfcount, redisPfmerge functions.

Should be on CRAN in a week or two depending on some other work on the package.

knight1128 commented 8 years ago

@bwlewis Thank you for your serving. I can use pfcount/pfadd/pfmerge for you.