diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 1 | ||||
-rw-r--r-- | internal/config/defaults.go | 1 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 25 |
3 files changed, 27 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 3cd67525f..a738dded4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -195,6 +195,7 @@ type CacheConfiguration struct { AccountMemRatio float64 `name:"account-mem-ratio"` AccountNoteMemRatio float64 `name:"account-note-mem-ratio"` AccountSettingsMemRatio float64 `name:"account-settings-mem-ratio"` + AccountStatsMemRatio float64 `name:"account-stats-mem-ratio"` ApplicationMemRatio float64 `name:"application-mem-ratio"` BlockMemRatio float64 `name:"block-mem-ratio"` BlockIDsMemRatio float64 `name:"block-mem-ratio"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index f5f8fb6ac..e84e619b8 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -159,6 +159,7 @@ var Defaults = Configuration{ AccountMemRatio: 5, AccountNoteMemRatio: 1, AccountSettingsMemRatio: 0.1, + AccountStatsMemRatio: 2, ApplicationMemRatio: 0.1, BlockMemRatio: 2, BlockIDsMemRatio: 3, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index a8c919834..c986dd19d 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -2825,6 +2825,31 @@ func GetCacheAccountSettingsMemRatio() float64 { return global.GetCacheAccountSe // SetCacheAccountSettingsMemRatio safely sets the value for global configuration 'Cache.AccountSettingsMemRatio' field func SetCacheAccountSettingsMemRatio(v float64) { global.SetCacheAccountSettingsMemRatio(v) } +// GetCacheAccountStatsMemRatio safely fetches the Configuration value for state's 'Cache.AccountStatsMemRatio' field +func (st *ConfigState) GetCacheAccountStatsMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.AccountStatsMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheAccountStatsMemRatio safely sets the Configuration value for state's 'Cache.AccountStatsMemRatio' field +func (st *ConfigState) SetCacheAccountStatsMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.AccountStatsMemRatio = v + st.reloadToViper() +} + +// CacheAccountStatsMemRatioFlag returns the flag name for the 'Cache.AccountStatsMemRatio' field +func CacheAccountStatsMemRatioFlag() string { return "cache-account-stats-mem-ratio" } + +// GetCacheAccountStatsMemRatio safely fetches the value for global configuration 'Cache.AccountStatsMemRatio' field +func GetCacheAccountStatsMemRatio() float64 { return global.GetCacheAccountStatsMemRatio() } + +// SetCacheAccountStatsMemRatio safely sets the value for global configuration 'Cache.AccountStatsMemRatio' field +func SetCacheAccountStatsMemRatio(v float64) { global.SetCacheAccountStatsMemRatio(v) } + // GetCacheApplicationMemRatio safely fetches the Configuration value for state's 'Cache.ApplicationMemRatio' field func (st *ConfigState) GetCacheApplicationMemRatio() (v float64) { st.mutex.RLock() |