ShiftAggregate (v1.0.0)

Running shift metrics snapshot with per-period breakdowns

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

FieldTypeDescription
lineIdstringProduction line identifier
factoryId, operationArea, processLinestringEnriched from line-config
produced, scrapped, reworkedintCumulative counts for the shift
scrapByReasonCodemap<string, int>Scrap count broken down by reason code
scrapRatedoublescrapped / (produced + scrapped + reworked)
scrapVelocityPerHourdoubleProjected scrap parts per hour
scrapVelocityBucketsmap<string, int>Time-bucketed scrap counts for rolling velocity
hoursRemainingdoubleHours until shift end
shiftTargetPiecesintTarget production for the shift
currentPeriodstringName of the active shift period (default: Production)
periodSnapshotsmap<string, PeriodSnapshot>Per-period aggregate breakdowns
customFieldsmap<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 }
}
}