GROWTH
GROWTH = 'classification.unclassified_growth'
Code raised when unclassified keys grow past what was last decided.
Finds out what is actually in the ephemeral keyspace, and how much of it there is.
Classification cannot be decided from a list of what Drupal ships, because the keyspace on a real site is mostly contributed: a module's own cache bin, a queue named after a feed, a lock nobody documented. So the keyspace is discovered by asking whatever holds it, grouped into patterns, and measured.
The measurement is the point. A pattern covering three keys and a pattern covering two million both need a decision, but only one of them is worth an administrator's attention, and only one of them will dominate the storage bill if it turns out to be captured. So every pattern carries its observed key count and byte total, and the admin UI sorts by the second.
Where the keys come from is left to a source, because the answer differs per site: Redis when
strata_redis is installed, the cache and key-value tables otherwise. A source that fails is
reported and the pass continues over the others - one unreachable backend must not stop the rest
of the keyspace being described.
$sources : list<\Drupal\strata\Capture\Classifier\KeyspaceSourceInterface>
Sources the keyspace is read from.
$registry : \Drupal\strata\Capture\Classifier\ClassificationRegistry
$tripwires : \Drupal\strata\Health\TripwireRegistry
$ledger : \Drupal\strata\Health\HealthLedgerInterface
__construct(\Drupal\strata\Capture\Classifier\ClassificationRegistry $registry, \Drupal\strata\Health\TripwireRegistry $tripwires, \Drupal\strata\Health\HealthLedgerInterface $ledger, \Psr\Log\LoggerInterface $logger) : mixed
Constructs a discovery pass.
| \Drupal\strata\Capture\Classifier\ClassificationRegistry | $registry | Where observations and decisions are stored. |
| \Drupal\strata\Health\TripwireRegistry | $tripwires | Runs the growth check over the result. |
| \Drupal\strata\Health\HealthLedgerInterface | $ledger | Where a growth finding is recorded. |
| \Psr\Log\LoggerInterface | $logger | Records what a pass found. |
addSource(\Drupal\strata\Capture\Classifier\KeyspaceSourceInterface $source) : void
Adds a source of keys.
Collected from the container, so a submodule contributes one by tagging a service rather than by this class knowing what backends exist.
| \Drupal\strata\Capture\Classifier\KeyspaceSourceInterface | $source | The source. |
discover(int $limit = 10000) : \Drupal\strata\Capture\Classifier\DiscoveryReport
Walks every source and records what it holds.
| int | $limit | Most keys to read from each source, so a pass over a large Redis stays bounded. |
What was found.