-
Notifications
You must be signed in to change notification settings - Fork 1
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
query: add experimental Select() cache #36
base: v0.29.0+vinted
Are you sure you want to change the base?
Conversation
Add experiment support for caching select() requests. Only local tests for now. Cache works on matching identical request signatures. Data is cached only on io.EOF error; if something else occurs then the response is not cached. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
462632b
to
6f22322
Compare
"github.com/thanos-io/thanos/pkg/tls" | ||
"github.com/thanos-io/thanos/pkg/tracing" | ||
) | ||
|
||
// StoreClientGRPCOpts creates gRPC dial options for connecting to a store client. | ||
func StoreClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure, skipVerify bool, cert, key, caCert, serverName string) ([]grpc.DialOption, error) { | ||
func StoreClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure, skipVerify bool, cert, key, caCert, serverName string, maxCacheSize model.Bytes) ([]grpc.DialOption, error) { |
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.
Style question, wouldn't it be better to refactor long function like this? (so that you wouldn't need to use horizontal slider to see all function params 😄 )
func StoreClientGRPCOpts(
logger log.Logger,
reg *prometheus.Registry,
tracer opentracing.Tracer,
secure, skipVerify bool,
cert, key, caCert, serverName string,
maxCacheSize model.Bytes,
) ([]grpc.DialOption, error) {
//...
}
} | ||
} | ||
|
||
var fetchKeys = make([]string, 0, numKeys) |
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.
style nit: var fetchKeys = ...
-> fetchKeys := make([]string, 0, numKeys)
?
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 trust u
Add experiment support for caching select() requests. Only local tests for now. Cache works on matching identical request signatures. Data is cached only on io.EOF error; if something else occurs then the response is not cached.
Signed-off-by: Giedrius Statkevičius giedrius.statkevicius@vinted.com