allegro / allegro/bigcache

Misleading name for config

Abierto
#295 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
8.2k
Forks
614
Merge medio
5 d 12 h
PR fusionados (30 d)
1

Descripción

`// 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.