Schedule#
Core cron does not wake up at noon. Analytic treats noon as the first
cron at or after analytic.settings:collection_time. The default is
12:00 in the site timezone (system.date:timezone.default). Hourly
system cron keeps that close to noon. The three-hour Automated Cron
interval can land later.
hook_cron() only enqueues. The analytic_collect queue worker
calculates one collector and one period. One failing View does not drop
the others. A second cron the same day does not write a second row,
because success is stored in state:
analytic.collector.{collector id}.{sequence}.{start}
The state key is set when the period is resolved. A stored sample and a deliberate NULL skip both set it. A retry of a stored sample merges on the unique key, so it cannot duplicate the row. A period that is still queued is not added again.
What is due after the collection time, for every enabled collector:
- Day. Today's date, if it is not stored yet. This is the only
period that calls
calculate(). - Week, month, year. The period that just closed, if it is not stored yet. The value comes from stored day rows. A sum needs every day in the window. A snapshot uses the day row on the period end date. A missing day is marked resolved and left empty. Only that latest closed period is recorded. Older gaps stay empty.
Week boundaries use week_start. The default is Monday (1). Sunday
is 7.
A dependency listed on the plugin waits until the other collector has a state key for the same day. Rollups do not wait, because they read this collector's own day rows. The queue item is released and tried on a later cron. Cron does not add a second item while that one is waiting.
Record now, on the collector list, queues the current day and runs the
analytic queue immediately. The status message says whether this pass
wrote a row. force still runs after a NULL skip.