Daily Operations
Everything you do hands-on with Tenant Analytics: reading the Analytics tab, running a manual fleet sweep with the live console, re-sweeping a single tenant after a fix, and rebuilding the platform rollups for a date.
tenant_analytics_snapshot cron runs every night at 03:00, so most days you just
read the tab. The manual actions below are for catching up after downtime, verifying a
change immediately, or refreshing one tenant you just fixed.
Opening the Analytics tab
Go to Settings → Tenants and choose the Analytics tab. It loads for administrators on the platform's main database. If you open it from inside a tenant session you are redirected away — this is a platform-operator view only.
The tab has four regions: the KPI cards, the toolbar (date + metric group), the per-tenant snapshots table, and the platform-aggregate panel.
1. The KPI cards
Four cards summarise the currently selected date at a glance:
| Card | Meaning |
|---|---|
| Tenants swept | How many tenants have a snapshot for this date, out of
the total number of tenants targeted (e.g. 18 / 20). |
| Coverage | The percentage of targeted tenants that were successfully swept for the date. Low coverage means a sweep was partial or missed tenants. |
| Failures | How many tenants recorded a failed snapshot for the date — a tenant the sweep could not connect to or measure. |
| Last run | How long ago the most recent sweep finished (or “running” / “never”). |
2. The toolbar: date & metric group
Two selectors drive everything below them:
- Date — defaults to the latest date that has data. Pick any date within the retention window to look back in time. A Recent dates jump list offers the most recent swept dates.
- Metric group — choose which of the seventeen groups (overview, payslips, payrolls, employees, attendance, leaves, establishments, schedules, departments, de minimis, loans) the table and aggregate panel show.
Changing either one refreshes the snapshots table, the aggregate panel, and the KPI numbers.
3. The per-tenant snapshots table
One row per tenant for the selected date and group. Columns:
| Column | What it shows |
|---|---|
| Tenant | Company name and slug. |
| Tenant status | That tenant's platform status as of the sweep (active, suspended / maintenance, archived). |
| Group status | How the measurement went for this group: ok, partial, unavailable (the tenant doesn't have that module/table), or failed. |
| Rows | The record count behind the metric (e.g. number of payslips) — a quick sense of scale. |
| Build ms | How long that tenant's measurement took, in milliseconds. |
| Updated | How long ago this snapshot was written. |
| Actions | A menu with View payload and (with the run permission) Re-sweep tenant. |
View payload opens a modal showing that tenant's full JSON measurement for the group.
Every payload carries a meta block — see
Reading the numbers below.
4. The platform-aggregate panel
To the right, the aggregate panel shows the fleet-wide total for the selected date and group — exactly what the public API would return. It shows:
- Tenants counted / total and tenants failed — how many tenants contributed to the aggregate.
- The aggregate JSON itself (sums of the numeric metrics across all tenants).
- An API on / API off badge, and the public API URL when the API is enabled (otherwise a hint that it is off).
Running a manual sweep
When you need fresh numbers now — after downtime, a data fix, or a new tenant — run a
sweep from the tab instead of waiting for the nightly cron. It requires the
tenant_analytics_run permission.
-
Open the sweep console
Click Run snapshot now on the Tenants tab bar. A modal opens with the sweep options.
-
Choose the options
Date — the snapshot date (defaults to today). Scope — All tenants (respects the include-inactive setting) or Active only. Metric groups — all seventeen are ticked by default; untick any you want to skip. Dry run — measure everything but write nothing (a safe rehearsal).
-
Start it and watch the console
Click Start sweep. The modal switches to a live view: a progress bar and percentage, an elapsed timer, four counters (Total / Processing / Done / Failed), a scrolling timestamped console, and a per-tenant status list (Pending → ok / partial / failed).
-
Let it finish
The sweep runs in small batches so no single request runs long. When it completes it rebuilds the platform rollups for the date (unless it was a dry run) and refreshes the tab automatically.
Re-sweeping a single tenant
Fixed one tenant's data and want its numbers refreshed without sweeping the whole fleet? Use the row action:
-
Find the tenant
In the snapshots table, locate the tenant's row for the current date and group.
-
Re-sweep it
Open the row's action menu and choose Re-sweep tenant, then confirm. It re-measures that tenant for the selected metric group (or all groups), replaces its snapshot, and rebuilds the platform rollups for the date.
-
Confirm the result
The table, aggregate panel, and KPIs refresh. The tenant's group status should now read ok.
Rebuilding the platform rollups
The rollup is the platform aggregate the tab (and public API) reads. Sweeps rebuild it automatically, but you can rebuild it on demand for a date — for example after manually adjusting snapshots, or if a rollup looks stale.
-
Pick the date
Set the toolbar Date to the day you want to recompute.
-
Rebuild
Click Rebuild rollups on the tab bar. It re-aggregates that date's existing snapshots into the platform rollups — no tenants are re-measured, so it is quick.
Reading the numbers correctly
A few conventions matter when interpreting a payload:
- Zero means one of two very different things
- Every snapshot payload carries a
metablock with a module-enabled map, the list of tables present, and a collected-at timestamp. Use it to tell “0 because there genuinely is no data” from “0 because that tenant doesn't run the module/table” (which shows as an unavailable group status). - Money counts only finalised payroll
- Payslip money totals (gross, net, deductions, tax, contributions) count only pending and approved payslips. Drafts are excluded by design, mirroring how the rest of ERPat reports payroll money.
- Windows: today, month-to-date, year-to-date, last 30 days
- Money and count metrics are sliced into time windows so you can see both the running total and recent activity for the selected date.
- Inactive tenants are included by default
- Suspended and archived tenants are swept too (unless you narrow the scope), so the fleet total reflects the whole platform, not just live tenants.