-
Notifications
You must be signed in to change notification settings - Fork 816
Add Redis support #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Redis support #1612
Conversation
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Hi @dmitsh! This PR looks pretty good to me so far. I wonder why you've choosen to separate out the |
@tomwilkie The main rationale was to follow |
added unit test Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@tomwilkie please take a look. I also added a unit test. |
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks broadly OK, thanks for the PR!
I was a little surprised that it allows tiering of redis on top of memcached, which seems unlikely.
It's simpler to add redis as a whole separate thing to memcached, but I think the result is more hostile to users who end up with dozens of new options.
Similarly it would be good to combine the metrics rather than exporting two sets, of which one set is useless.
Oh, and you should add a line to CHANGELOG for the release. |
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@bboreham I've implemented the changes we discussed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should mix the cache configs together. We should separate them. We do the same in ring kv stores (consul, etcd) for example.
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
added unit test Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
…is-cache Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@gouthamve per our discussion I have made requested changes. |
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bboreham I spoke with Dmitry and we decided it is best to keep the specific config options separate. Right now it's cleaner as we're simply doing a {Memcached/Redis}Config.RegisterFlags
and calling a NewRedisCache(RedisConfig)
.
If we had a common host and timeout, we'd be doing something similar to:
cfg.RedisConfig.Host = cfg.Host
cfg.RegisConfig.Timeout = cfg.Timeout
And similarly for Memcached. Further, having it this way would also mean we are backwards compatible and nothing needs to be deprecated.
Though we have -redis.hostname
and memcached.hostname
now, I think it's clearer to the users here.
Curious to know your thoughts on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial thoughts.
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adding support for Redis.
Reference: issue #1333