Add data simulation

merge-requests/1/head
charithag 9 years ago
parent edc4b1766f
commit f4b974ea52

@ -43,8 +43,23 @@ var data;
var groupId; var groupId;
if (uriMatcher.match("/{context}/api/event/list")) { if (uriMatcher.match("/{context}/api/event/list")) {
/*
var timeInterval = 30;
var i, rnd;
result = [];
var currentDay = new Date();
var startDate = currentDay.getTime() - (60 * 60 * 24 * 100);
var endDate = currentDay.getTime();
var i = parseInt(startDate / 1000);
while (i < parseInt(endDate / 1000)) {
rnd = rnd = Math.random() * 50;
result.push({time: i, deviceName: 'device' + rnd, activity:'Event number ' + rnd});
i += timeInterval;
}
*/
try { try {
fetchedData = statsClient.getRecentDeviceStats(user, 10); result = statsClient.getRecentDeviceStats(user, 10);
} catch (error) { } catch (error) {
log.error(error); log.error(error);
} }

Loading…
Cancel
Save