This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mqtt = require('mqtt'); | |
const _ = require('lodash'); | |
const memwatch = require('memwatch-next'); | |
const util = require('util'); | |
const setTimeoutPromise = util.promisify(setTimeout); | |
memwatch.on('leak', (info) => { | |
console.error('Memory leak detected:\n', info); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Redis = require('ioredis'); | |
const _ = require('lodash'); | |
const randomstring = require('randomstring'); | |
const util = require('util'); | |
let redisCluster; | |
async function createRedisCluster() { | |
const cluster = new Redis.Cluster([{ | |
port: 30001, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE STREAM "DESTINATION_SQL_STREAM" ( | |
entity_id VARCHAR(64), | |
avg_power DOUBLE); | |
CREATE OR REPLACE PUMP "STREAM_PUMP" AS INSERT INTO "DESTINATION_SQL_STREAM" | |
SELECT STREAM | |
entity_id, | |
AVG(active_power) OVER secs_window | |
FROM "SOURCE_SQL_STREAM_001" | |
WINDOW | |
secs_window AS (PARTITION BY entity_id RANGE INTERVAL '5' SECOND PRECEDING) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('hey') | |
EVT.use(EVT.Hub); | |
app.getAvailableHubs().then(function(hubs) { | |
console.log('hey2'); | |
EVT.Hub.setup({ | |
targetHub: hubs[0], | |
remote: false | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
(c) Copyright Reserved EVRYTHNG Limited 2016. All rights reserved. | |
Use of this material is subject to license. | |
Copying and unauthorised use of this material strictly prohibited. | |
*/ | |
const evtClient = new EVT.TrustedApp(apiKey); | |
function onThngPropertiesChanged(event) { | |
console.log('Running onThngPropertiesChanged'); | |
evtClient.thng('UDhdsNDnAYNC52aBEQM2rrWm').action('_custom').create({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
(c) Copyright Reserved EVRYTHNG Limited 2016. All rights reserved. | |
Use of this material is subject to license. | |
Copying and unauthorised use of this material strictly prohibited. | |
*/ | |
const evtClient = new EVT.TrustedApp(apiKey); | |
function onThngPropertiesChanged(event) { | |
console.log('event: ', event); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onThngPropertiesChanged = (event) => { | |
console.log('Running onThngPropertiesChanged6'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onThngPropertiesChanged = (event) => { | |
console.log('Running onThngPropertiesChanged5'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onThngPropertiesChanged = (event) => { | |
console.log('Running onThngPropertiesChanged4'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onThngPropertiesChanged = (event) => { | |
console.log('Running onThngPropertiesChanged3'); | |
} |
NewerOlder