Skip to content

Instantly share code, notes, and snippets.

@akb
Created September 7, 2012 16:59
Show Gist options
  • Save akb/3667776 to your computer and use it in GitHub Desktop.
Save akb/3667776 to your computer and use it in GitHub Desktop.
// Schema:
{
"type":"object",
"id":"#telemetry",
"properties":{
"t": { "type":"number", "optional":true }, // optional because of enter event
"type": {
"type": "string",
"enum":["basic", "enter", "go", "response", "submit", "exit"]
},
"attributes": {"type":"object", "optional":true}
}
}
/*
Examples:
<Telemetry>
<Enter start="2011-01-24 09:16:50.743"/>
<Go t="35000" item="999001"/>
<Response t="41574" answer="2"/>
<Response t="47510" answer="4"/>
<Go t="53100" item="999002"/>
<Go t="59111" item="999003"/>
<Go t="71111" screen="Pause"/>
<Go t="300000" screen="Pause" method="Idle"/>
<Exit t="444444"/>
<Enter start="2011-01-24 15:33:11.251"/>
<Response t="24000" answer="2"/>
<Go t="31000" screen="Review"/>
<Submit t="35000"/>
<Exit t="35000"/>
</Telemetry>
*/
telemetry([
{"type":"enter", "attributes":{"start":"2011-01-24 09:16:50.743"}},
{"type":"go", "t":41574, "attributes":{"item":"999001"}},
{"type":"response", "t":41574, "attributes":{"answer":"2"}},
{"type":"response", "t":47510, "attributes":{"answer":"4"}},
{"type":"go", "t":53100, "attributes":{"item":"999002"}},
{"type":"go", "t":59111, "attributes":{"item":"999003"}},
{"type":"go", "t":71111, "attributes":{"screen":"Pause"}},
{"type":"go", "t":300000, "attributes":{"screen":"Pause", "method":"Idle"}},
{"type":"exit", "t":444444 },
{"type":"enter", "attributes":{"start":"2011-01-24 15:33:11.251"}},
{"type":"response", "t":24000, "attributes":{"answer":"2"}},
{"type":"go", "t":31000, "attributes":{"screen":"Review"}},
{"type":"submit", "t":35000}},
{"type":"exit", "t":35000}}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment