drupal_redis_stats

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

Drupal Redis Stats

GoDoc Go Report Card Build Status codecov OpenSSF Scorecard FOSSA Status

This command provides a summary of the use of a Redis database by the Drupal 10 or Drupal 9 cache provider.

It relies on Redis SCAN operator instead of KEYS, so it won't block your site when used on production.

Installing

Assuming Go 1.21 or later installed:

go get -u github.com/fgm/drupal_redis_stats

Using

Flags
  • -h provides help
  • -dsn flag allows using a non-default Redis
    • -dsn redis://<host>:<port>/<db> without authentication
    • -dsn redis://<password>@<host>:<port>/<db> for requirepass AUTH mode
    • -dsn redis://<user>:<password>@<host>:<port>/<db> for ACL AUTH mode
  • -json provides JSON output instead of the default human-readable format
  • -q disables the progress bar used during the database SCAN loop
Sample results
Bin                | Entries |     Size
-------------------+---------+---------
bootstrap          |      10 |     6056
config             |    7992 |  4741812
data               |   10483 |  7717813
default            |     183 |   130061
discovery          |     240 |   164028
dynamic_page_cache |    6104 | 11225548
entity             |     785 |   506817
menu               |      28 |    30646
page               |    6125 |  5222326
render             |   12877 | 19965812
-------------------+---------+---------
Total              |   44832 | 49714857

The Entries column provides the number of entries in a cache bin, while the Size bin provides the size used by keys and data in Redis storage, based on information provided by the MEMORY USAGE command.

Documentation

Overview

This simple CLI application scans a Redis database for Drupal 8 cache content.

It then return statistics about that instance, in plain text or JSON.

Directories

Path Synopsis
Package output provides functions to output Drupal cache statistics.
Package output provides functions to output Drupal cache statistics.
Package stats extracts Drupal 8 cache information from a Redis database.
Package stats extracts Drupal 8 cache information from a Redis database.
progress
Package progress implements a simple progress bar.
Package progress implements a simple progress bar.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL