[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:
@@ -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",
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user