Skip to content
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

Open
wants to merge 1 commit into
base: v0.29.0+vinted
Choose a base branch
from

Conversation

GiedriusS
Copy link
Collaborator

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 [email protected]

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 <[email protected]>
"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) {
Copy link

@Titasp Titasp Dec 14, 2022

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)
Copy link

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) ?

Copy link

@Titasp Titasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i trust u

@GiedriusS GiedriusS changed the title query: add experiment Select() cache query: add experimental Select() cache Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants