A running snapshot of production metrics for a specific line during a shift. Emitted by the stream-processor whenever meaningful changes occur. Includes per-period breakdowns (startup, production, break, shutdown) and scrap velocity buckets.
Key Fields
| Field | Type | Description |
|---|---|---|
| lineId | string | Production line identifier |
| factoryId, operationArea, processLine | string | Enriched from line-config |
| produced, scrapped, reworked | int | Cumulative counts for the shift |
| scrapByReasonCode | map<string, int> | Scrap count broken down by reason code |
| scrapRate | double | scrapped / (produced + scrapped + reworked) |
| scrapVelocityPerHour | double | Projected scrap parts per hour |
| scrapVelocityBuckets | map<string, int> | Time-bucketed scrap counts for rolling velocity |
| hoursRemaining | double | Hours until shift end |
| shiftTargetPieces | int | Target production for the shift |
| currentPeriod | string | Name of the active shift period (default: Production) |
| periodSnapshots | map<string, PeriodSnapshot> | Per-period aggregate breakdowns |
| customFields | map<string, string> | Extension attributes |
Example
{ "lineId": "LINE-A", "factoryId": "FACTORY-01", "operationArea": "CNC-MACHINING", "processLine": "CNC-LATHE-01", "shiftName": "Morning", "produced": 247, "scrapped": 19, "reworked": 5, "scrapByReasonCode": { "DIM_OUT_OF_SPEC": 11, "SURFACE_FINISH": 5, "TOOL_WEAR": 3 }, "scrapRate": 0.0769, "scrapVelocityPerHour": 4.75, "scrapVelocityBuckets": { "1743676200000": 3, "1743677100000": 2 }, "shiftTargetPieces": 500, "hoursRemaining": 4.0, "currentPeriod": "Production", "periodSnapshots": { "Startup": { "periodName": "Startup", "periodType": "STARTUP", "produced": 12, "scrapped": 2, "reworked": 0, "scrapRate": 0.1429 }, "Production": { "periodName": "Production", "periodType": "PRODUCTION", "produced": 235, "scrapped": 17, "reworked": 5, "scrapRate": 0.0661 } }}