Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 2 Next »

Ingestion Specification

  1. Define and Event Grammar

{
  "instrument_details": {
    "type": "COUNTER",
    "key": "count"
  },
  "name": "attendance_by_school_grade_for_a_day",
  "is_active": true,
  "event_schema": {
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "default": {},
    "title": "attendance_by_school_grade_for_a_day",
    "required": ["date", "grade", "school_id", "count"],
    "properties": {
      "date": {
        "type": "string",
        "default": "",
        "title": "The date Schema",
        "examples": ["2019-01-01"]
      },
      "grade": {
        "type": "integer",
        "default": 0,
        "title": "The grade Schema",
        "examples": [1]
      },
      "school_id": {
        "type": "integer",
        "default": 0,
        "title": "The school_id Schema",
        "examples": [901]
      }
    },
    "examples": [
      {
        "date": "2019-01-01",
        "grade": 1,
        "school_id": 901,
        "count": 23
      }
    ]
  }
}

2. Publish an event that satisfies the grammar

{
    "date": "2019-01-01",
    "grade": 1,
    "school_id": 901,
    "count": 23
}

Transformer Specification

How this event is processed is defined by a pipe.

const transformer = {
    name: "transformer_name",
    event_schema: "es11",
    dataset_schema: "ds23",
    config: {
        spawn((callback, receive) => {
            // send to parent
            callback('SOME_EVENT');

            // receive from parent
            receive((event) => {
            // handle event
            });

            // disposal
            return () => {
            /* do cleanup here */
            };
        }),
    }
}