Documentation ¶
Overview ¶
Package stats extracts Drupal 8 cache information from a Redis database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheStats ¶
type CacheStats struct { //TODO #1 implement these fields. //memoryUsed uint64 //memoryPeak uint64 //drupalVersion string //TODO #2 //drupalPrefix string TotalKeys uint32 // Redis hardcoded limit. Stats map[string]BinStats }
CacheStats represents the discovered information about Drupal cache data held in a Redis database.
func (CacheStats) ItemCountLength ¶
func (cs CacheStats) ItemCountLength() uint
ItemCountLength returns the length in runes of the total number of keys.
Since this is the sum of all bins, it is at least as large as any per-bin info.
func (CacheStats) MaxBinNameLength ¶
func (cs CacheStats) MaxBinNameLength() int
MaxBinNameLength returns the length in runes of the longest bin name.
func (*CacheStats) Scan ¶
Scan examines the active database for keys matching the Drupal cache bin format.
- c is the established connection to Redis on which to perform the Scan.
- maxPasses allows limiting the number of Redis SCAN steps. Use 0 for no limit.
- writer is a logging output (think os.Stderr), not the main output.
func (CacheStats) TotalSize ¶
func (cs CacheStats) TotalSize() int64
TotalSize returns the total ize used by the cache.
By Redis MEMORY USAGE description, this includes both keys and data.
func (CacheStats) TotalSizeLength ¶
func (cs CacheStats) TotalSizeLength() int
TotalSizeLength returns the length in runes of the cache size, expressed in bytes.
Since this is the sum of all bins, it is at least as large as any per-bin info.