diff options
Diffstat (limited to 'Software/Visual_Studio_22/Tango.Portal.Chat.Web/Data/schema.json')
| -rw-r--r-- | Software/Visual_Studio_22/Tango.Portal.Chat.Web/Data/schema.json | 464 |
1 files changed, 464 insertions, 0 deletions
diff --git a/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Data/schema.json b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Data/schema.json new file mode 100644 index 000000000..41da6e63a --- /dev/null +++ b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Data/schema.json @@ -0,0 +1,464 @@ +{ + "tables": { + "JobRunsTable": { + "columns": { + "ID": "string", + "SerialNumber": "string", + "MachineType": "string", + "Environment": "string", + "Organization": "string", + "Site": "string", + "CreatedTime": "datetime", + "UploadTime": "datetime", + "JobName": "string", + "Kind": "string", + "Thread": "string", + "NumberOfUnits": "int", + "InterSegmentLength": "int", + "LubricationEnabled": "bool", + "SpoolTypeDistribution": "int", + "NumberOfSpools": "int", + "LogicalLength": "real", + "ActualLength": "real", + "TotalLength": "real", + "StartPosition": "real", + "EndPosition": "real", + "Distance": "real", + "StartTime": "datetime", + "EndTime": "datetime", + "Duration": "timespan", + "HeatingDuration": "timespan", + "Status": "string", + "OutputCyan": "long", + "OutputMagenta": "long", + "OutputYellow": "long", + "OutputBlack": "long", + "OutputLightCyan": "long", + "OutputLightMagenta": "long", + "OutputLightYellow": "long", + "OutputBlue": "long", + "OutputLightBlue": "long", + "OutputOrange": "long", + "OutputLightOrange": "long", + "OutputRubine": "long", + "OutputLightRubine": "long", + "OutputNavy": "long", + "OutputViolet": "long", + "OutputTransparent": "long", + "OutputLubricant": "long", + "FailureReason": "string", + "ApplicationVersion": "string", + "FirmwareVersion": "string", + "Segments": "dynamic", + "FineTuning": "dynamic", + "ProcessParameters": "dynamic" + }, + + "primaryTimeColumn": "StartTime", + "fallbackTimeColumns": [ "CreatedTime", "EndTime" ], + "defaultTimeWindowDays": 30, + + "keys": { + "primaryKey": [ "ID" ], + "machineKey": [ "SerialNumber" ], + "orgKeys": [ "Organization", "Site" ] + }, + + "enums": { + "Status": [ "Completed", "Failed", "Aborted" ], + "Kind": [ "Default", "FineTuning" ], + "Environment": [ "DEV", "TEST", "BETA", "PROD" ] + }, + + "units": { + "Distance": "meters", + "LogicalLength": "meters", + "ActualLength": "meters", + "TotalLength": "meters", + "StartPosition": "meters", + "EndPosition": "meters", + "Duration": "timespan", + "HeatingDuration": "timespan", + "Output*": "nanoliters" + }, + + "display": { + "rename": { + "Thread": "ThreadType" + }, + "preferPercentBreakdowns": [ "Status" ] + }, + + "joinHints": [ + { + "table": "MachinesTable", + "on": [ "SerialNumber" ], + "why": "Bring Organization/Site or versions from machine master data." + } + ], + + "notes": [ + "Each row is a single job run.", + "Use StartTime for most time filters. if not found use CreatedTime", + "Thread is the thread profile/type used for the job.", + "Ink outputs (Output*) are in nanoliters.", + "Distance = EndPosition - StartPosition.", + "FineTuning is only populated when Kind == 'FineTuning'.", + "FailureReason is only meaningful when Status == 'Failed'." + ], + + "guardrails": { + "requireTimeFilter": false, + "maxRowsSuggested": 200, + "encourageSummarizeOrTop": true + }, + + "fewShot": [ + { + "user": "What are the most used thread types by jobs in the last 7 days?", + "kql": "JobRunsTable\n| where EndTime between (from .. to)\n| summarize Jobs=count() by Thread\n| top 5 by Jobs desc" + }, + { + "user": "Failure rate per site last 30 days", + "kql": "JobRunsTable\n| where EndTime between (from .. to)\n| summarize Total=count(), Failed=countif(Status == 'Failed') by Site\n| extend FailureRate = 100.0 * todouble(Failed) / todouble(Total)\n| order by FailureRate desc" + }, + { + "user": "Total ink usage by color for Organization X this week", + "kql": "JobRunsTable\n| where EndTime between (from .. to) and Organization == 'Twine'\n| summarize Cyan=sum(OutputCyan), Magenta=sum(OutputMagenta), Yellow=sum(OutputYellow), Black=sum(OutputBlack), Transparent=sum(OutputTransparent), Lubricant=sum(OutputLubricant)" + }, + { + "user": "Average job duration by machine type yesterday", + "kql": "JobRunsTable\n| where EndTime between (from .. to)\n| summarize AvgDuration=avg(Duration) by MachineType\n| order by AvgDuration desc" + }, + { + "user": "Top failure reasons in the past 14 days", + "kql": "JobRunsTable\n| where EndTime between (from .. to) and Status == 'Failed' and isnotempty(FailureReason)\n| summarize Failures=count() by FailureReason\n| top 10 by Failures desc" + } + ] + }, + "JobStatusTable": { + "columns": { + "SerialNumber": "string", + "CreatedTime": "datetime", + "State": "string", + "OverallTemperature": "real", + "Status": "dynamic" + }, + "notes": [ + "High-volume time series of machine status snapshots. Short retention." + ] + }, + "MachinesTable": { + "columns": { + "ID": "int", + "GUID": "string", + "LAST_UPDATED": "datetime", + "SERIAL_NUMBER": "string", + "NAME": "string", + "PRODUCTION_DATE": "datetime", + "ORGANIZATION_GUID": "string", + "SITE_GUID": "string", + "MACHINE_VERSION_GUID": "string", + "CONFIGURATION_GUID": "string", + "DEFAULT_RML_GUID": "string", + "LOADED_RML_GUID": "string", + "TARGET_JOB_TYPES": "string", + "TARGET_COLOR_SPACE_CODES": "string", + "DEFAULT_COLOR_SPACE_GUID": "string", + "DEFAULT_SEGMENT_LENGTH": "real", + "DEFAULT_SPOOL_TYPE_GUID": "string", + "OS_KEY": "string", + "AUTO_LOGIN": "bool", + "AUTO_CHECK_FOR_UPDATES": "bool", + "SETUP_ACTIVATION": "bool", + "SETUP_REMOTE_ASSISTANCE": "bool", + "SETUP_UWF": "bool", + "SETUP_FIRMWARE": "bool", + "SETUP_FPGA": "bool", + "IS_DEMO": "bool", + "SUSPEND_VERSION_UPDATE": "bool", + "FORCE_VERSION_UPDATE": "bool", + "PERFORM_SCHEMA_UPDATE_ON_DATA_UPDATE": "bool", + "DEVICE_COM_PORT": "string", + "IS_DEVICE_REGISTERED": "bool", + "DEVICE_ID": "string", + "DEVICE_NAME": "string", + "HEAD_TYPE": "int", + "ACTIVATION_KEY": "string", + "LIGHT_INKS_INSTALLED": "bool", + "BTSR_INSTALLED": "bool", + "VERSION_TAG": "string", + "MACHINE_TYPE": "int", + "ALLOW_SMS_NOTIFICATIONS": "bool", + "ENVIRONMENT": "string" + }, + + "keys": { + "primaryKey": [ "GUID" ], + "machineKey": [ "SERIAL_NUMBER" ] + }, + + "display": { + "rename": { + "SERIAL_NUMBER": "SerialNumber", + "LAST_UPDATED": "LastUpdated", + "MACHINE_TYPE": "MachineType", + "ENVIRONMENT": "Environment" + } + }, + + "joinHints": [ + { + "table": "JobRunsTable", + "on": [ "SerialNumber == MachinesTable.SERIAL_NUMBER" ], + "why": "Enrich job runs with machine metadata (organization/site/version). Note: column casing differs." + }, + { + "table": "OrganizationsTable", + "on": [ "GUID == MachinesTable.ORGANIZATION_GUID" ], + "why": "Get the machine's organization name'." + }, + { + "table": "SitesTable", + "on": [ "GUID == MachinesTable.SITE_GUID" ], + "why": "Get the machine's site name'. If no site than the machine does not belong to any site." + } + ], + + "notes": [ + "Column names here are UPPER_SNAKE_CASE and are case-sensitive in Kusto.", + "Use GUID as the stable machine identifier; SERIAL_NUMBER is the human-facing ID used in JobRunsTable.", + "Map JobRunsTable.SerialNumber to MachinesTable.SERIAL_NUMBER for joins.", + "If duplicate rows arrive, use arg_max(LAST_UPDATED, *) by GUID to keep the latest." + ] + }, + "LogsTable": { + "columns": { + "SerialNumber": "string", + "MachineType": "string", + "Environment": "string", + "Organization": "string", + "Site": "string", + "CreatedTime": "datetime", + "UploadTime": "datetime", + "Source": "string", + "Category": "string", + "Class": "string", + "Method": "string", + "Line": "int", + "Message": "string" + }, + + "primaryTimeColumn": "CreatedTime", + "fallbackTimeColumns": [ "UploadTime" ], + "defaultTimeWindowDays": 7, + + "keys": { + "machineKey": [ "SerialNumber" ] + }, + + "enums": { + "Category": [ "Info", "Warning", "Error", "Critical", "Debug" ], + "Source": [ "Application", "Firmware" ] + }, + + "notes": [ + "Application logs emitted by services/apps running on or about the machines.", + "Use CreatedTime for time filters; UploadTime is the ingestion/upload timestamp.", + "Category is limited to Info, Warning, Error, Critical, Debug.", + "Source can be either Application or Firmware where Firmware represents logs generated by the embedded device and Application is everything else." + ], + + "guardrails": { + "requireTimeFilter": false, + "maxRowsSuggested": 200, + "encourageSummarizeOrTop": false + }, + + "joinHints": [ + { + "table": "JobRunsTable", + "on": [ "SerialNumber" ], + "why": "Correlate logs to jobs on the same machine in a time window." + } + ], + + "display": { + "rename": { + "CreatedTime": "Time" + } + } + }, + "EventTypesTable": { + "columns": { + "ID": "int", + "GUID": "string", + "LAST_UPDATED": "datetime", + "CODE": "int", + "NAME": "string", + "TITLE": "string", + "DESCRIPTION": "string", + "TECHNICAL_DESCRIPTION": "string", + "COMPONENT_INDEX": "int", + "EVENT_CATEGORY": "int", + "EVENT_GROUP": "int", + "EVENT_NOTIFICATION_TIME": "int", + "EVENT_ACTIONS": "string", + "REQUIRES_USER_INTERVENTION": "bool", + "GUIDANCE": "string", + "PERSISTENT": "bool" + }, + + "keys": { + "primaryKey": [ "GUID" ], + "codeKey": [ "CODE" ] + }, + + "display": { + "rename": { + "LAST_UPDATED": "LastUpdated", + "EVENT_CATEGORY": "EventCategory", + "EVENT_GROUP": "EventGroup", + "EVENT_NOTIFICATION_TIME": "NotificationTimeSec", + "REQUIRES_USER_INTERVENTION": "RequiresUserIntervention" + } + }, + + "notes": [ + "Lookup/dimension table describing event types.", + "Join to EventsTable on EventsTable.EventTypeGuid == EventTypesTable.GUID.", + "EVENT_CATEGORY/GROUP are numeric buckets; TITLE/NAME are human-friendly.", + "If duplicate rows arrive, use arg_max(LAST_UPDATED, *) by GUID to keep the latest." + ] + }, + "EventsTable": { + "columns": { + "SerialNumber": "string", + "MachineType": "string", + "Environment": "string", + "Organization": "string", + "Site": "string", + "CreatedTime": "datetime", + "UploadTime": "datetime", + "ID": "string", + "HostName": "string", + "EventTypeGuid": "string", + "Description": "string" + }, + + "primaryTimeColumn": "CreatedTime", + "fallbackTimeColumns": [ "UploadTime" ], + "defaultTimeWindowDays": 7, + + "keys": { + "eventKey": [ "ID" ], + "machineKey": [ "SerialNumber" ] + }, + + "joinHints": [ + { + "table": "EventTypesTable", + "on": [ "EventTypeGuid == EventTypesTable.GUID" ], + "why": "Bring title/category/code/technical description and flags like RequiresUserIntervention/Persistent." + }, + { + "table": "MachinesTable", + "on": [ "SerialNumber == MachinesTable.SERIAL_NUMBER" ], + "why": "Enrich events with machine master data (org/site/version)." + } + ], + + "guardrails": { + "requireTimeFilter": true, + "maxRowsSuggested": 200, + "encourageSummarizeOrTop": true + }, + + "notes": [ + "Each row is a concrete event occurrence on a machine.", + "Use CreatedTime for time range filters; UploadTime indicates ingestion.", + "EventTypeGuid maps to EventTypesTable.GUID for metadata (title, category, etc.)." + ] + }, + "OrganizationsTable": { + "columns": { + "ID": "int", + "GUID": "string", + "LAST_UPDATED": "datetime", + "NAME": "string", + "CONTACT_GUID": "string", + "ADDRESS_GUID": "string", + "ENVIRONMENT": "string" + }, + "keys": { + "primaryKey": [ "GUID" ], + "identityKey": [ "ID" ] + }, + "display": { + "rename": { + "NAME": "Name", + "LAST_UPDATED": "LastUpdated", + "ENVIRONMENT": "Environment" + } + }, + "joinHints": [ + { + "table": "SitesTable", + "on": [ "SitesTable.ORGANIZATION_GUID == OrganizationsTable.GUID" ], + "why": "Attach sites to their parent organization." + }, + { + "table": "MachinesTable", + "on": [ "MachinesTable.ORGANIZATION_GUID == OrganizationsTable.GUID" ], + "why": "Filter or aggregate machines by organization." + } + ], + "notes": [ + "Column names are UPPER_SNAKE_CASE and case-sensitive in Kusto.", + "ENVIRONMENT is populated by ADF at sink time (not present in source SQL).", + "Prefer joining by GUID; ID is a SQL identity surrogate and may differ across environments.", + "If duplicate rows arrive, use arg_max(LAST_UPDATED, *) by GUID to keep the latest." + ] + }, + "SitesTable": { + "columns": { + "ID": "int", + "GUID": "string", + "LAST_UPDATED": "datetime", + "ORGANIZATION_GUID": "string", + "NAME": "string", + "DESCRIPTION": "string", + "ENVIRONMENT": "string" + }, + "keys": { + "primaryKey": [ "GUID" ], + "identityKey": [ "ID" ] + }, + "display": { + "rename": { + "LAST_UPDATED": "LastUpdated", + "ORGANIZATION_GUID": "OrganizationGuid", + "ENVIRONMENT": "Environment" + } + }, + "joinHints": [ + { + "table": "OrganizationsTable", + "on": [ "SitesTable | join kind=inner (OrganizationsTable) on $left.ORGANIZATION_GUID == $right.GUID and $left.ENVIRONMENT == $right.ENVIRONMENT)" ], + "why": "Attach each site to its parent organization." + }, + { + "table": "MachinesTable", + "on": [ "MachinesTable.SITE_GUID == SitesTable.GUID" ], + "why": "List or aggregate machines that belong to a site." + } + ], + "notes": [ + "DESCRIPTION is nullable in SQL; ADX string accepts null/empty.", + "ENVIRONMENT is injected by ADF at sink time (not present in source SQL).", + "Prefer GUID-based joins; ID is a SQL identity and may vary across environments.", + "To de-duplicate mirrored rows, use arg_max(LAST_UPDATED, *) by GUID." + ] + } + } +}
\ No newline at end of file |
