Appearance
Analytics field validation (smoke checklist)
This is software smoke validation for the Analytics hub — not hardware bench testing. For BOM/sensor bench status see Validation status.
Last updated: with Ask, learned watches, and vibration.
Prerequisites
- Backend migrations applied (
npm run migrateinbackend— through0044_analytics_watches.sql). - Logged-in tenant user with at least one device type that has telemetry.
- Optional: an asset tree with devices assigned (for rollup).
- Optional: profile calculated fields enabled (
CALCULATED_FIELDS_ENABLEDdefault true).
Metric Explorer
| Step | Expected |
|---|---|
| Open Analytics → Metric Explorer | Page loads; device types and keys populate |
| Select type + key + range → Run / auto-load | KPI, Top-N, time series fill when data exists |
| Set Above/Below thresholds | Anomaly count updates |
| Change bucket (5m / 1h / 1d) | Series re-buckets |
Fleet risk / exceedance
| Step | Expected |
|---|---|
| Set Above/Below + run | Fleet risk table ranks by crossings, then samples over, then time over limit |
| First page | Top risky devices for the type (≈ top 10 at page size 10) |
| No thresholds | Warning — do not treat as failure risk |
| API | POST /api/analytics/fleet-forecast-risk |
Profile: Analytics industry profile.
Forecast
| Step | Expected |
|---|---|
| Choose Linear or Predictive | Alert shows that mode’s device / point limits; device count cannot exceed max |
| Load explorer with enough points | Forecast chart + method tag (linear_regression, seasonal_naive, or statsforecast:*) |
| Predictive + worker up | Method like statsforecast:auto_ets when FORECAST_WORKER_URL is set |
| Predictive with worker down / sparse data | Falls back to seasonal-naive or linear (fallback) |
| Pattern heatmap | Hour × weekday card fills from series sample |
| Request more devices than cap | Server truncates; limits.truncated true |
| API | GET /api/analytics/forecast-limits · POST /api/analytics/forecast with engine |
Statistical anomalies (z-score)
| Step | Expected |
|---|---|
| Load explorer on a key with variation | Table lists devices with latest z and Anomalous/OK |
| Flat series (stdDev ≈ 0) | z ≈ 0, not flagged |
| API | POST /api/analytics/statistical-anomaly with zThreshold (default 2.5) |
Asset rollup
| Step | Expected |
|---|---|
| Pick asset + key → Run rollup | Device count + agg / min / max |
| Asset with no devices | Zero devices / empty values |
| API | POST /api/analytics/asset-rollup |
Shared saved views
| Step | Expected |
|---|---|
| Save as Private | Visible only to owner |
| Save as Whole tenant | Other tenant users see it in Saved views |
| Save as Shared emails + comma list | Only listed emails (+ owner) see it |
| Open from Saved views | Explorer filters restore; visibility column shows mode |
| Migrations | 0039 + 0040 applied (migrate:status Pending: 0) |
Ask
| Step | Expected |
|---|---|
| Open Analytics → Ask | Suggestion buttons name fleets and readings this tenant already has |
| Press a machine or meter suggestion | One sentence and a bar chart for that device type and key |
| Ask with no fleet and no reading | The answer lists fleets and one reading each |
| “When will voltage on a named device reach a number?” | A line and a sentence. A flat series says it is not moving toward the limit |
| “Analyze vibration” with no vibration key | The answer says no vibration series is present |
| Watch sentence for one named device | A row appears under Watches. Remove deletes it. No watch is created for other devices |
APIs: GET /api/analytics/prompts · POST /api/analytics/chat · GET/POST /api/analytics/watches · DELETE /api/analytics/watches/:id.
Calculated fields (ingest)
| Step | Expected |
|---|---|
Profile has calculated_fields expression | Derived key appears on next telemetry ingest / bulk write |
CALCULATED_FIELDS_ENABLED=false | Expressions skipped |
Alarm ops
| Step | Expected |
|---|---|
| Analytics → Alarm ops | MTTA/MTTC, severity, noisy rules/devices for range |
Quick API smoke (authenticated)
http
POST /api/analytics/forecast
POST /api/analytics/statistical-anomaly
POST /api/analytics/asset-rollup
GET /api/analytics/saved-views
POST /api/analytics/saved-viewsBodies match Metric Explorer selections (deviceIds/key/from/to, or assetId for rollup; visibility + sharedWithEmails for saves).
