allegro / allegro/bigcache

Misleading name for config

Aperta
#295 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
8.2k
Fork
614
Merge medio
5g 12h
PR unite (30g)
1

Descrizione

`// initialShardSize computes initial shard size
func (c Config) initialShardSize() int {
return max(c.MaxEntriesInWindow/c.Shards, minimumEntriesInShard)
}

// maximumShardSize computes maximum shard size
func (c Config) maximumShardSize() int {
maxShardSize := 0

if c.HardMaxCacheSize > 0 {
maxShardSize = convertMBToBytes(c.HardMaxCacheSize) / c.Shards
}

return maxShardSize
}`

initialShardSize returns the number of entries in a shard while maximumShardSize returns the storage size of a shard which can be confirmed by the following usage

` entries: *queue.NewBytesQueue(config.initialShardSize()*config.MaxEntrySize, config.maximumShardSize(), config.Verbose),
`
config.MaxEntrySize is the storage size

If I didn't make it wrong I would suggest rename the functions as following:
initialShardSize -> initalEntriesNumsInSingleShards

"size" usually means the storage size and "number" usually means the count or number of something

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.