-
Notifications
You must be signed in to change notification settings - Fork 85
[WIP] POC implementation of caching mechanism #1925
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
base: master
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,119 @@ | |||
| package nsxt | |||
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.
Can we place this in another package? nsxt is already overloaded
| @@ -0,0 +1,139 @@ | |||
| terraform { | |||
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.
This file shouldn't be part of the PR
| @@ -0,0 +1,79 @@ | |||
| #!/bin/bash | |||
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.
This file shouldn't be part of the PR
| @@ -0,0 +1,7 @@ | |||
| TIMESTAMP VPC_COUNT SUBNET_COUNT PLAN_SECONDS APPLY_SECONDS STATUS PLAN CACHE_ENABLED | |||
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.
This file shouldn't be part of the PR
|
|
||
| type cache struct { | ||
| mu sync.RWMutex | ||
| data map[string]map[string]*data.StructValue //key: query , key DisplayName and objects |
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.
The mutex here is for the entire cache - I think that this is inefficient.
IMO data here can be a `map[string]
Where struct contains the map and a mutex - we have no issue with access to the cache of VpcSubnet while accessing the cache of some other type.
I guess that this will require some changes though as data is keyed by query string - IDK if this is doable.
| } | ||
|
|
||
| // SetCacheEnabled allows enabling/disabling cache for benchmarking | ||
| var cacheEnabled = os.Getenv("NSXT_ENABLE_CACHE") == "true" |
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.
This should be also enabled/disabled by a provider-level attribute - you can use allow_unverified_ssl as an example for how to use both environment var and a provider attribute for activation
No description provided.