[Tables] Support for subscriptions from new Telemetry API

Historical and real-time data flowing

Added formatting, and limits. Support telemetry objects themselves and not just composition of telemetry objects

Apply default time range if none supplied (15 minutes)
This commit is contained in:
Henry
2016-12-06 18:04:47 -08:00
parent 6d5530ba9c
commit 976333d7f7
12 changed files with 159 additions and 592 deletions

View File

@@ -75,8 +75,7 @@ define([
},
{
"key": "delta",
"name": "Delta",
"format": "example.delta"
"name": "Delta"
}
],
"priority": -1
@@ -103,11 +102,13 @@ define([
"domains": [
{
"key": "utc",
"name": "Time"
"name": "Time",
"format": "utc"
},
{
"key": "yesterday",
"name": "Yesterday"
"name": "Yesterday",
"format": "utc"
},
{
"key": "delta",

View File

@@ -24,6 +24,7 @@
(function () {
var FIFTEEN_MINUTES = 15 * 60 * 1000;
var handlers = {
subscribe: onSubscribe,
@@ -82,8 +83,11 @@
function onRequest(message) {
var data = message.data;
if (!data.start || !data.end) {
throw new Error('missing start and end!');
if (data.end == undefined) {
data.end = Date.now();
}
if (data.start == undefined){
data.start = data.end - FIFTEEN_MINUTES;
}
var now = Date.now();